Skip to content
Browse files

allow symbols starting with dot

  • Loading branch information...
1 parent bfad44a commit 70463e5e5b8dd37fcacf4c4a0bbfe51b4a9d0047 @adh committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/number.c
View
9 src/number.c
@@ -445,7 +445,14 @@ dfsch_object_t* dfsch_make_number_from_string_noerror(char* string, int obase){
if (base != 10 && base != 0){
return NULL;
}
- return dfsch_make_number_from_double(atof(string));
+ char* endptr;
+ double d = strtod(string, &endptr);
+
+ if (*endptr != '\0'){
+ return NULL;
+ }
+
+ return dfsch_make_number_from_double(d);
}
if (*string == '-'){

0 comments on commit 70463e5

Please sign in to comment.
Something went wrong with that request. Please try again.