From d9238da690d5eda9cb5139aa26734dff5ded2285 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Wed, 27 Jul 2011 20:06:17 +0000 Subject: bugfix git-svn-id: https://svn.kapsi.fi/jpa/nanopb@946 e3a754e5-d11d-0410-8d38-ebb782a927b9 --- pb_decode.c | 4 ++-- 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 -- cgit 1.2.3-korg