I am having trouble understanding this code:
static long long _be_decode_int(const char **data, long long *data_len)
{
char *endp;
long long ret = strtoll(*data, &endp, 10);
*data_len -= (endp - *data);
*data = endp;
return ret;
}
I have changed strtoll
to _strtoi64
because I am programming on Windows and believe them to perform the same function.
According to the MSDN page for _strtoi64, the second parameter should be a pointer to the character that ends the string. If endp
has only just been declared, what does it point to?