Skip to content

Commit

Permalink
bdecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
ghazel committed Feb 17, 2018
1 parent 092b09e commit 267fce9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dht.c
Original file line number Diff line number Diff line change
Expand Up @@ -2852,8 +2852,10 @@ long bdecode_int(const unsigned char *str, size_t len, const unsigned char **end
str++;
len--;
}
for(; len > 0 && isdigit(*str); str++, len--) {
while(len > 0 && isdigit(*str)) {
value = value * 10 + (*str - '0');
str++,
len--;
}
*endptr = len > 0 ? str : NULL;
return sign * value;
Expand Down

0 comments on commit 267fce9

Please sign in to comment.