fix encoding of big values
authorMichael Schroeder <mls@suse.de>
Thu, 18 Oct 2012 14:09:32 +0000 (16:09 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 18 Oct 2012 14:09:32 +0000 (16:09 +0200)
src/repopack.h

index c551022..81b7b88 100644 (file)
@@ -41,6 +41,7 @@ data_read_id(unsigned char *dp, Id *idp)
       *idp = x;
       return dp + 5;
     }
+  x ^= 80;
   dp += 5;
   for (;;)
     {
@@ -87,7 +88,7 @@ data_read_num64(unsigned char *dp, unsigned int *low, unsigned int *high)
       *high = (dp[0] ^ 0x80) >> 4;
       return dp + 5;
     }
-  x = (unsigned long long)(dp[0] ^ 0x80) << 28 ^ (unsigned int)(dp[1] << 21 ^ dp[2] << 14 ^ dp[3] << 7 ^ dp[4] ^ 0x10204000);
+  x = (unsigned long long)(dp[0] ^ 0x80) << 28 ^ (unsigned int)(dp[1] << 21 ^ dp[2] << 14 ^ dp[3] << 7 ^ dp[4] ^ 0x10204080);
   dp += 5;
   for (;;)
     {