Skip to content

Commit b783258

Browse files
committed
Merge pull request #1 from shuttler/master
fixed sign extension of 'btree_u64_from_big' funcation
2 parents 15e7fdc + 2b85ae9 commit b783258

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

btree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ uint64_t btree_u64_from_big(unsigned char *buf) {
151151
val |= (uint64_t) buf[1] << 48;
152152
val |= (uint64_t) buf[2] << 40;
153153
val |= (uint64_t) buf[3] << 32;
154-
val |= buf[4] << 24;
155-
val |= buf[5] << 16;
156-
val |= buf[6] << 8;
157-
val |= buf[7];
154+
val |= (uint64_t) buf[4] << 24;
155+
val |= (uint64_t) buf[5] << 16;
156+
val |= (uint64_t) buf[6] << 8;
157+
val |= (uint64_t) buf[7];
158158
return val;
159159
}
160160

0 commit comments

Comments
 (0)