diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-06-16 10:58:33 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-06-16 10:58:33 -0600 |
commit | 024168def914d6275c88079882324b74d33420aa (patch) | |
tree | 7537de96d1927b222d4b8c29f2cb789a2ba6f4e6 /apps/system/hex2bin | |
parent | bfe81e16996b33cfe9f087fe277cf415d24295ce (diff) | |
download | px4-nuttx-024168def914d6275c88079882324b74d33420aa.tar.gz px4-nuttx-024168def914d6275c88079882324b74d33420aa.tar.bz2 px4-nuttx-024168def914d6275c88079882324b74d33420aa.zip |
hex2bin: Fix un-necessary seeks because expected address was not being updated
Diffstat (limited to 'apps/system/hex2bin')
-rw-r--r-- | apps/system/hex2bin/hex2bin.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/system/hex2bin/hex2bin.c b/apps/system/hex2bin/hex2bin.c index 1de5763f1..95634fcc8 100644 --- a/apps/system/hex2bin/hex2bin.c +++ b/apps/system/hex2bin/hex2bin.c @@ -589,7 +589,9 @@ int hex2bin(FAR struct lib_instream_s *instream, goto errout_with_einval; } - /* Seek to the correct position in the OUT stream */ + /* Seek to the correct position in the OUT stream if we have + * made an unexpected jump in the data address. + */ if (address != expected) { @@ -606,6 +608,10 @@ int hex2bin(FAR struct lib_instream_s *instream, /* Transfer data to the OUT stream */ writedata(outstream, &bin[DATA_BINNDX], bytecount); + + /* This is the next data address that we expect to see */ + + expected = address + bytecount; } break; |