aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parser.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2008-08-02 03:19:45 +0000
committerNicola Mettifogo2008-08-02 03:19:45 +0000
commitc349a8dcd914656e9d960337bfea7d9d84bd081b (patch)
treec5db26f10aa8bd276fc347593cf0f4f80b08e037 /engines/parallaction/parser.cpp
parent86079c20f53b3536d6c0522945106c42109671e2 (diff)
downloadscummvm-rg350-c349a8dcd914656e9d960337bfea7d9d84bd081b.tar.gz
scummvm-rg350-c349a8dcd914656e9d960337bfea7d9d84bd081b.tar.bz2
scummvm-rg350-c349a8dcd914656e9d960337bfea7d9d84bd081b.zip
* Increasing max number of allowed token on one line.
* Increasing buffer size to match old parser. svn-id: r33512
Diffstat (limited to 'engines/parallaction/parser.cpp')
-rw-r--r--engines/parallaction/parser.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index 35936dfed7..97caa9dc6c 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -28,8 +28,10 @@
namespace Parallaction {
+#define MAX_TOKENS 50
+
int _numTokens;
-char _tokens[20][MAX_TOKEN_LEN];
+char _tokens[MAX_TOKENS][MAX_TOKEN_LEN];
Script::Script(Common::ReadStream *input, bool disposeSource) : _input(input), _disposeSource(disposeSource), _line(0) {}
@@ -66,7 +68,7 @@ char *Script::readLine(char *buf, size_t bufSize) {
void Script::clearTokens() {
- for (uint16 i = 0; i < 20; i++)
+ for (uint16 i = 0; i < MAX_TOKENS; i++)
_tokens[i][0] = '\0';
_numTokens = 0;
@@ -154,7 +156,7 @@ char *parseNextToken(char *s, char *tok, uint16 count, const char *brk, bool ign
uint16 Script::fillTokens(char* line) {
uint16 i = 0;
- while (strlen(line) > 0 && i < 20) {
+ while (strlen(line) > 0 && i < MAX_TOKENS) {
line = parseNextToken(line, _tokens[i], MAX_TOKEN_LEN, " \t\n");
line = Common::ltrim(line);
i++;
@@ -315,10 +317,10 @@ class CommentStatementDef : public StatementDef {
Common::String parseComment(Script &script) {
Common::String result;
- char buf[129];
+ char buf[401];
do {
- script.readLine(buf, 128);
+ script.readLine(buf, 400);
buf[strlen(buf)-1] = '\0';
if (!scumm_stricmp(buf, "endtext"))
break;