X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flisp%2Flexer.cpp;h=90f4aa28c831f87c6690451f210c4a0bf7e21df3;hb=b917bb4789b14d1bb1445b9777ab494e9623fd50;hp=451cb9aff706383bed1567cc0d50c247a4473ac5;hpb=aee6c4dede5a9c4fa0f7eb134fba61fef738a573;p=supertux.git diff --git a/src/lisp/lexer.cpp b/src/lisp/lexer.cpp index 451cb9aff..90f4aa28c 100644 --- a/src/lisp/lexer.cpp +++ b/src/lisp/lexer.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "lexer.hpp" @@ -102,8 +103,8 @@ Lexer::getNextToken() return TOKEN_CLOSE_PAREN; case '"': { // string int startline = linenumber; - nextChar(); while(1) { + nextChar(); switch(c) { case '"': nextChar(); @@ -132,7 +133,8 @@ Lexer::getNextToken() default: break; } - addChar(); + if(token_length < MAX_TOKEN_LENGTH) + token_string[token_length++] = c; } string_finished: token_string[token_length] = 0;