From 366580543a60df279667b9447117ee61e50f8be9 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 2 Oct 2009 18:22:44 -0500 Subject: Fix: Make next_hexstring handle optional quotes Ericsson MBM devices send CRSM information as hex strings, yet enclose them in quotes which is not according to the standard. --- gatchat/gatresult.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gatchat') diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c index ee02c0ca..1436ae30 100644 --- a/gatchat/gatresult.c +++ b/gatchat/gatresult.c @@ -228,6 +228,9 @@ gboolean g_at_result_iter_next_hexstring(GAtResultIter *iter, goto out; } + if (line[pos] == '"') + pos += 1; + end = pos; while (end < len && g_ascii_isxdigit(line[end])) @@ -241,6 +244,9 @@ gboolean g_at_result_iter_next_hexstring(GAtResultIter *iter, for (; pos < end; pos += 2) sscanf(line + pos, "%02hhx", bufpos++); + if (line[end] == '"') + end += 1; + out: iter->line_pos = skip_to_next_field(line, end, len); -- cgit v1.2.3