From: Keith Packard Date: Sun, 3 Dec 2017 05:21:55 +0000 (-0600) Subject: altos/lisp: use strtof instead of atof X-Git-Tag: 1.8.3~1^2~22^2~9 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=b9009b3916956db00b7b78bd06fb0df704690eb1 altos/lisp: use strtof instead of atof atof returns double, strtof returns float. Signed-off-by: Keith Packard --- diff --git a/src/lisp/ao_lisp_read.c b/src/lisp/ao_lisp_read.c index 747963ab..f3b627bb 100644 --- a/src/lisp/ao_lisp_read.c +++ b/src/lisp/ao_lisp_read.c @@ -15,6 +15,7 @@ #include "ao_lisp.h" #include "ao_lisp_read.h" #include +#include static const uint16_t lex_classes[128] = { IGNORE, /* ^@ */ @@ -445,7 +446,7 @@ _lex(void) return NUM; } if (isfloat && hasdigit) { - token_float = atof(token_string); + token_float = strtof(token_string, NULL); return FLOAT; } for (u = 0; u < NUM_NAMED_FLOATS; u++) @@ -524,8 +525,7 @@ ao_lisp_read(void) char *string; int cons; int read_state; - ao_poly v; - + ao_poly v = AO_LISP_NIL; cons = 0; read_state = 0;