I am unable to convert a string to a long using strtol. Having a leading "."
before the number in the string returns 0.
Without the "."
strtol returns 3456
as expected.
#include <stdio.h>
#include <stdlib.h>
int main ()
{
char str[20] = " . 3456\r\n";
long ret = strtol(str, NULL, 10);
printf("ret is %ld\n",ret);
return(0);
}