From ea9c6b32e952e1d87872b992989854e4899cb8f8 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Oct 2010 20:57:50 +0000 Subject: Corrected a bug that made negative numbers between -64 and -127 inclusive corrupt. --- src/integer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/integer.h') 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 if( iIn < 0 ) { iIn = -iIn; - b = (iIn&0x3F) | 0x40; + b = (iIn&0x3F); + if( iIn > b ) + b |= 0x80 | 0x40; } else { b = (iIn&0x3F); + if( iIn > b ) + b |= 0x80; } - if( iIn > b ) - b |= 0x80; rStream.write( &b, 1 ); iIn = iIn >> 6; -- cgit v1.2.3