All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gatchat: fix to number parsing when number is omitted
@ 2011-03-09  7:27 Paavo Leinonen
  2011-03-09 22:03 ` Denis Kenzior
  2011-03-11 12:25 ` [PATCH] atmodem: fix PB reading when fields are omitted Paavo Leinonen
  0 siblings, 2 replies; 4+ messages in thread
From: Paavo Leinonen @ 2011-03-09  7:27 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

Line position index must be updated the number field is empty. Otherwise
we will read same field again in subsequent calls.
---

Hi,

While testing SIM Phonebook we noticed that Email addresses stored to SIM PB
were not properly parsed by oFono. Root cause for this was 
g_at_result_iter_next_number which did not update iterator's line_pos
attribute when number was missing. As a result, wrong fields were 
read when parsing email field (among others).

Entry was following:

+CPBR: 1,"12356789*#98#*",129,"Esko M\303\226rk\303\266",,,,,"M\303\266lkky","longandhardemailaddress(a)huhhuhjuu.mobi"

Br,
Paavo

 gatchat/gatresult.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c
index f992486..fb9f4d5 100644
--- a/gatchat/gatresult.c
+++ b/gatchat/gatresult.c
@@ -281,11 +281,11 @@ gboolean g_at_result_iter_next_number(GAtResultIter *iter, gint *number)
 		end += 1;
 	}
 
+	iter->line_pos = skip_to_next_field(line, end, len);
+
 	if (pos == end)
 		return FALSE;
 
-	iter->line_pos = skip_to_next_field(line, end, len);
-
 	if (number)
 		*number = value;
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-11 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09  7:27 [PATCH] gatchat: fix to number parsing when number is omitted Paavo Leinonen
2011-03-09 22:03 ` Denis Kenzior
2011-03-11 12:25 ` [PATCH] atmodem: fix PB reading when fields are omitted Paavo Leinonen
2011-03-11 19:56   ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.