summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-07-01 10:48:03 -0500
committerMarcel Holtmann <marcel@holtmann.org>2009-07-01 14:55:22 -0700
commit5c8f57e95e5aca9f4d3cf647edb9ec634052c6da (patch)
treefbbba863af3611b7414b4dc2cd464aa2d709d00a
parent8d8280485169135c83cfc3247c4bbf22c708b6fb (diff)
downloadconnman-5c8f57e95e5aca9f4d3cf647edb9ec634052c6da.tar.gz
connman-5c8f57e95e5aca9f4d3cf647edb9ec634052c6da.tar.bz2
connman-5c8f57e95e5aca9f4d3cf647edb9ec634052c6da.zip
Fix uninitialized use of bufpos
-rw-r--r--gatchat/gatresult.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c
index 7a983083..9c382d91 100644
--- a/gatchat/gatresult.c
+++ b/gatchat/gatresult.c
@@ -174,6 +174,7 @@ gboolean g_at_result_iter_next_hexstring(GAtResultIter *iter,
len = strlen(line);
pos = iter->line_pos;
+ bufpos = iter->buf + pos;
/* Omitted string */
if (line[pos] == ',') {
@@ -192,7 +193,7 @@ gboolean g_at_result_iter_next_hexstring(GAtResultIter *iter,
*length = (end - pos) / 2;
- for (bufpos = iter->buf + pos; pos < end; pos += 2)
+ for (; pos < end; pos += 2)
sscanf(line + pos, "%02hhx", bufpos++);
out: