summaryrefslogtreecommitdiff
path: root/pbstream.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-02-25 09:43:37 -0800
committerJoshua Haberman <joshua@reverberate.org>2009-02-25 09:43:37 -0800
commit537ca81ada8de051c5c316cdee87e3d466aa2bc7 (patch)
treee642cdd5e46fbcae2ea371984f6ae0b6d8bcbb64 /pbstream.c
parentecd855279d0984b3c0191ce1e60f0b4690af2f39 (diff)
Credit where credit is due.
Diffstat (limited to 'pbstream.c')
-rw-r--r--pbstream.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pbstream.c b/pbstream.c
index 5994b9c..f60e59f 100644
--- a/pbstream.c
+++ b/pbstream.c
@@ -26,6 +26,7 @@ static pbstream_status_t get_v_uint64_t(char **buf, uint64_t *val)
uint32_t b;
uint32_t part0 = 0, part1 = 0, part2 = 0;
+ /* From the original proto2 implementation. */
b = *(ptr++); part0 = (b & 0x7F) ; if (!(b & 0x80)) goto done;
b = *(ptr++); part0 |= (b & 0x7F) << 7; if (!(b & 0x80)) goto done;
b = *(ptr++); part0 |= (b & 0x7F) << 14; if (!(b & 0x80)) goto done;
@@ -50,6 +51,7 @@ static pbstream_status_t get_v_uint32_t(char **buf, uint32_t *val)
uint32_t b;
uint32_t result;
+ /* From the original proto2 implementation. */
b = *(ptr++); result = (b & 0x7F) ; if (!(b & 0x80)) goto done;
b = *(ptr++); result |= (b & 0x7F) << 7; if (!(b & 0x80)) goto done;
b = *(ptr++); result |= (b & 0x7F) << 14; if (!(b & 0x80)) goto done;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback