diff options
author | Willem Jan Palenstijn | 2008-09-14 22:28:53 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2008-09-14 22:28:53 +0000 |
commit | c8eeae8d4dffa5849a23cf963884027a7789504b (patch) | |
tree | 1f2a0de23851cb7e7d1d77114c8379aa27f4fb85 /engines/m4/globals.cpp | |
parent | fbfe30bf861af9b83325e0c7fecd4b0a68da5af9 (diff) | |
download | scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.tar.gz scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.tar.bz2 scummvm-rg350-c8eeae8d4dffa5849a23cf963884027a7789504b.zip |
Big patch changing semantics of ReadStream::eos():
eos() now only returns true _after_ trying to read past the end of the stream.
This has a large potential for regressions. Please test!
svn-id: r34549
Diffstat (limited to 'engines/m4/globals.cpp')
-rw-r--r-- | engines/m4/globals.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp index 58c68979d1..98d007f67e 100644 --- a/engines/m4/globals.cpp +++ b/engines/m4/globals.cpp @@ -295,8 +295,11 @@ void Globals::loadMadsVocab() { char buffer[30]; strcpy(buffer, ""); - while(!vocabS->eos()) { - buffer[curPos++] = vocabS->readByte(); + while(true) { + uint8 b = vocabS->readByte(); + if (vocabS->eos()) break; + + buffer[curPos++] = b; if (buffer[curPos - 1] == '\0') { // end of string, add it to the strings list _madsVocab.push_back(strdup(buffer)); @@ -315,8 +318,11 @@ void Globals::loadMadsQuotes() { char buffer[128]; strcpy(buffer, ""); - while(!quoteS->eos()) { - buffer[curPos++] = quoteS->readByte(); + while(true) { + uint8 b = quoteS->readByte(); + if (quoteS->eos()) break; + + buffer[curPos++] = b; if (buffer[curPos - 1] == '\0') { // end of string, add it to the strings list _madsQuotes.push_back(strdup(buffer)); |