diff options
author | Yang Gu <yang.gu@intel.com> | 2010-04-27 17:47:06 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-27 09:30:39 -0500 |
commit | def5c38094f52fe7f597db12ce74c45eca1699ff (patch) | |
tree | 367b5599614fbbd1586a04027ca38fe03e3a57ae | |
parent | a9c0be7339f3df75d1aaa5feb2330bd6a414582f (diff) | |
download | ofono-def5c38094f52fe7f597db12ce74c45eca1699ff.tar.bz2 |
stkutil: Move advance of ctlv to parse_dataobj
Not all the proactive commands have comprehension tlv other than
command details and device identities. So the appropriate code should
be moved to parse_dataobj() from stk_command_new_from_pdu().
-rw-r--r-- | src/stkutil.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/stkutil.c b/src/stkutil.c index b4279c16..33235509 100644 --- a/src/stkutil.c +++ b/src/stkutil.c @@ -2030,6 +2030,10 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter, entries = g_slist_prepend(entries, entry); } + + if (comprehension_tlv_iter_next(iter) != TRUE) + goto out; + entries = g_slist_reverse(entries); for (l = entries; l; l = l->next) { @@ -2048,6 +2052,7 @@ static gboolean parse_dataobj(struct comprehension_tlv_iter *iter, } } +out: for (l = entries; l; l = l->next) { struct dataobj_handler_entry *entry = l->data; @@ -2295,9 +2300,6 @@ struct stk_command *stk_command_new_from_pdu(const unsigned char *pdu, command->src = data[0]; command->dst = data[1]; - if (comprehension_tlv_iter_next(&iter) != TRUE) - return FALSE; - switch (command->type) { case STK_COMMAND_TYPE_DISPLAY_TEXT: ok = parse_display_text(command, &iter); |