char *endptr = NULL;
errno = 0;
double result = strtod(str, &endptr);
- if(*endptr != 0 || endptr == str) return "Could not parse double.";
- if(errno == ERANGE) return "Could not parse double.";
+ if(*endptr != 0 || endptr == str) return "Could not parse floating point number.";
+ if(errno == ERANGE) return "Could not parse floating point number.";
*((double *) dest) = result;
if(!str) return "Cannot parse bool: string is NULL.";
if(str[1] == 0) {
- if(str[0] == '1') {
+ if(str[0] == '0') {
*((bool *)dest) = false;
return NULL;
}