diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-10-20 20:57:50 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-10-20 20:57:50 +0000 |
commit | ea9c6b32e952e1d87872b992989854e4899cb8f8 (patch) | |
tree | 25ae6579ed24f39888488f6f759a2783f1b44fa9 /src/integer.h | |
parent | 811ab29d661266059abc28108d69c9a3e0b0fc88 (diff) | |
download | libgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.tar.gz libgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.tar.bz2 libgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.tar.xz libgats-ea9c6b32e952e1d87872b992989854e4899cb8f8.zip |
Corrected a bug that made negative numbers between -64 and -127 inclusive
corrupt.
Diffstat (limited to 'src/integer.h')
-rw-r--r-- | src/integer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/integer.h b/src/integer.h index be7c808..014b53a 100644 --- a/src/integer.h +++ b/src/integer.h | |||
@@ -49,14 +49,16 @@ namespace Gats | |||
49 | if( iIn < 0 ) | 49 | if( iIn < 0 ) |
50 | { | 50 | { |
51 | iIn = -iIn; | 51 | iIn = -iIn; |
52 | b = (iIn&0x3F) | 0x40; | 52 | b = (iIn&0x3F); |
53 | if( iIn > b ) | ||
54 | b |= 0x80 | 0x40; | ||
53 | } | 55 | } |
54 | else | 56 | else |
55 | { | 57 | { |
56 | b = (iIn&0x3F); | 58 | b = (iIn&0x3F); |
59 | if( iIn > b ) | ||
60 | b |= 0x80; | ||
57 | } | 61 | } |
58 | if( iIn > b ) | ||
59 | b |= 0x80; | ||
60 | rStream.write( &b, 1 ); | 62 | rStream.write( &b, 1 ); |
61 | iIn = iIn >> 6; | 63 | iIn = iIn >> 6; |
62 | 64 | ||