From f1752f177532c4a26bdbc4990c7a6c9c462b0756 Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Tue, 28 May 2013 09:59:20 -1000 Subject: [PATCH] Lisp parsing tweak: use atoi and strtof instead of scanf --- src/lisp/parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lisp/parser.cpp b/src/lisp/parser.cpp index 1ea6f80af..e6a4198bd 100644 --- a/src/lisp/parser.cpp +++ b/src/lisp/parser.cpp @@ -192,11 +192,11 @@ Parser::read() } case Lexer::TOKEN_INTEGER: result = new(obst) Lisp(Lisp::TYPE_INTEGER); - sscanf(lexer->getString(), "%d", &result->v.integer); + result->v.integer = atoi(lexer->getString()); break; case Lexer::TOKEN_REAL: result = new(obst) Lisp(Lisp::TYPE_REAL); - sscanf(lexer->getString(), "%f", &result->v.real); + result->v.real = strtof(lexer->getString(), NULL); break; case Lexer::TOKEN_TRUE: result = new(obst) Lisp(Lisp::TYPE_BOOLEAN); -- 2.11.0