projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c0b10b
)
Fix infinite loop when encountering \r in a string
author
Mathnerd314
<man.is.allan@gmail.com>
Sun, 3 May 2009 22:06:13 +0000
(22:06 +0000)
committer
Mathnerd314
<man.is.allan@gmail.com>
Sun, 3 May 2009 22:06:13 +0000
(22:06 +0000)
SVN-Revision: 5886
src/lisp/lexer.cpp
patch
|
blob
|
history
diff --git
a/src/lisp/lexer.cpp
b/src/lisp/lexer.cpp
index
451cb9a
..
18f28e2
100644
(file)
--- 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;