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