Browse Source

stupid sign extension

master
Felix von Leitner 6 years ago
parent
commit
d453330622
  1. 2
      scan/scan_varint.c

2
scan/scan_varint.c

@ -5,7 +5,7 @@ size_t scan_varint(const char* in,size_t len, unsigned long long* n) {
unsigned long long l;
if (len==0) return 0;
for (l=0, i=0; i<len; ++i) {
l+=(in[i]&0x7f) << (i*7);
l+=(unsigned long long)(in[i]&0x7f) << (i*7);
if (!(in[i]&0x80)) {
*n=l;
return i+1;

Loading…
Cancel
Save