diff options
author | Keith Packard <keithp@keithp.com> | 2017-12-02 23:21:55 -0600 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-12-02 23:21:55 -0600 |
commit | b9009b3916956db00b7b78bd06fb0df704690eb1 (patch) | |
tree | 5f634b96f2a4b2cccedfd3988174ca4bc7decc51 /src/lisp/ao_lisp_read.c | |
parent | 880c35363a2596202c8a3d980bf4ac41eceead66 (diff) |
altos/lisp: use strtof instead of atof
atof returns double, strtof returns float.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_read.c')
-rw-r--r-- | src/lisp/ao_lisp_read.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 <math.h> +#include <stdlib.h> 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; |