From 47670d9c2a85c767e675498bed522d4586aeefa1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 15 Jun 2014 13:28:03 -0600 Subject: hex2bin: Start code should not be in buffer --- apps/system/hex2bin/hex2bin.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/system/hex2bin/hex2bin.c b/apps/system/hex2bin/hex2bin.c index 28eb9df50..463de27e6 100644 --- a/apps/system/hex2bin/hex2bin.c +++ b/apps/system/hex2bin/hex2bin.c @@ -259,7 +259,14 @@ static int readstream(FAR struct lib_instream_s *instream, ch = instream->get(instream); } - /* Read until the end of line is encountered */ + /* Skip over the start code */ + + if (ch != EOF) + { + ch = instream->get(instream); + } + + /* Then read, verify, and buffer until the end of line is encountered */ while (ch != EOF && nbytes < (MAXRECORD_ASCSIZE-1)) { -- cgit v1.2.3