diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-06-22 17:57:10 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-06-22 17:57:10 -0700 |
commit | 0f26f514861e9ec6a86ea621c6202d87b5022525 (patch) | |
tree | 8cfa16ae8d147bce848b6bf94bc01455c688d098 | |
parent | 324d5cce9b8bf4802e7de80badbda410542348d0 (diff) |
Fix varint-skipping (oops).
-rw-r--r-- | upb_parse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/upb_parse.c b/upb_parse.c index d9e9485..f000501 100644 --- a/upb_parse.c +++ b/upb_parse.c @@ -55,9 +55,12 @@ done: static upb_status_t skip_v_uint64_t(void **buf) { - for(int i = 0; i < 10; i++, *buf++) { - uint8_t *b = *buf; - if(!(*b & 0x80)) return UPB_STATUS_OK; + uint8_t *b = *buf; + for(int i = 0; i < 10; i++, b++) { + if(!(*b & 0x80)) { + *buf = b; + return UPB_STATUS_OK; + } } return UPB_ERROR_UNTERMINATED_VARINT; } |