diff options
author | Petteri Aimonen <jpa@npb.mail.kapsi.fi> | 2011-07-27 20:06:17 +0000 |
---|---|---|
committer | Petteri Aimonen <jpa@npb.mail.kapsi.fi> | 2011-07-27 20:06:17 +0000 |
commit | d9238da690d5eda9cb5139aa26734dff5ded2285 (patch) | |
tree | ae1e6e5bdef26963dcd3a09c2bcc75a8fabf2679 | |
parent | 42e5fcc0bee38d183e1d00b4cecb1a5c831ed601 (diff) |
bugfix
git-svn-id: https://svn.kapsi.fi/jpa/nanopb@946 e3a754e5-d11d-0410-8d38-ebb782a927b9
-rw-r--r-- | pb_decode.c | 4 | ||||
-rw-r--r-- | tests/Makefile | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pb_decode.c b/pb_decode.c index 28856d37..a722e893 100644 --- a/pb_decode.c +++ b/pb_decode.c @@ -148,8 +148,8 @@ static bool read_raw_value(pb_istream_t *stream, int wire_type, uint8_t *buf, si { (*size)++; if (*size > max_size) return false; - if (!pb_read(stream, buf++, 1)) return false; - } while (*buf & 0x80); + if (!pb_read(stream, buf, 1)) return false; + } while (*buf++ & 0x80); return true; case WT_64BIT: diff --git a/tests/Makefile b/tests/Makefile index 3053fa4a..d357c674 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -10,4 +10,4 @@ test_decode1: test_decode1.c $(DEPS) $(CC) $(CFLAGS) -o $@ $< ../pb_decode.c fuzztest: test_decode1 - I=1; while cat /dev/urandom | ./test_decode1 > /dev/null; do I=$(($I+1)); echo -en "\r$I"; done
\ No newline at end of file + bash -c 'I=1; while cat /dev/urandom | ./test_decode1 > /dev/null; do I=$$(($$I+1)); echo -en "\r$$I"; done'
\ No newline at end of file |