From: Jann Horn Date: Tue, 28 May 2013 19:59:20 +0000 (-1000) Subject: Lisp parsing tweak: use atoi and strtof instead of scanf X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f1752f177532c4a26bdbc4990c7a6c9c462b0756;p=supertux.git Lisp parsing tweak: use atoi and strtof instead of scanf --- 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);