From c6d258ba8678391872befad186dfa7eb52c571bd Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 17 Mar 2010 16:27:32 -0300 Subject: [PATCH] obexd: Fix MaxListCount handling for PBAP PullPhoneBook function This parameter sent by the PCE indicates the maximum number of entries that the PCE can handle or need. --- obexd/plugins/phonebook-ebook.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obexd/plugins/phonebook-ebook.c b/obexd/plugins/phonebook-ebook.c index c5f681f7a..528adf365 100644 --- a/obexd/plugins/phonebook-ebook.c +++ b/obexd/plugins/phonebook-ebook.c @@ -66,8 +66,11 @@ static void ebookpull_cb(EBook *book, EBookStatus status, GList *contacts, struct query_data *data = user_data; GString *string = g_string_new(""); GList *l = g_list_nth(contacts, data->params->liststartoffset); + guint count = 0, maxcount = data->params->maxlistcount; - for (; l; l = g_list_next(l)) { + /* FIXME: Missing 0.vcf */ + + for (; l && count < maxcount; l = g_list_next(l), count++) { EContact *contact; EVCard *evcard; gchar *vcard; -- 2.47.3