CGE: Add safeguards in text manager

This commit is contained in:
Strangerke 2013-04-18 08:10:07 +02:00
parent 0aa028c3f1
commit e4ec07a6a1

View File

@ -68,7 +68,7 @@ int16 Text::count() {
for (line = tf.readLine(); !tf.eos(); line = tf.readLine()) {
char *s;
assert(line.size() <= 513);
strcpy(tmpStr, line.c_str());
if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL)
continue;
@ -101,7 +101,7 @@ void Text::load() {
for (idx = 0, line = tf.readLine(); !tf.eos(); line = tf.readLine()) {
int n = line.size();
char *s;
assert(n <= 513);
strcpy(tmpStr, line.c_str());
if ((s = strtok(tmpStr, " =,;/\t\n")) == NULL)
continue;