r1850 - branches/nexuiz-2.0/data/qcsrc/common
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Aug 23 12:27:29 EDT 2006
Author: div0
Date: 2006-08-23 12:27:29 -0400 (Wed, 23 Aug 2006)
New Revision: 1850
Modified:
branches/nexuiz-2.0/data/qcsrc/common/util.qc
Log:
endless loop with say_teem foo\ crash fixed
Modified: branches/nexuiz-2.0/data/qcsrc/common/util.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/util.qc 2006-08-23 16:26:32 UTC (rev 1849)
+++ branches/nexuiz-2.0/data/qcsrc/common/util.qc 2006-08-23 16:27:29 UTC (rev 1850)
@@ -25,7 +25,14 @@
}
else
{
- for (j = i;j < strlen(s);j++)
+ for (j = i+1;j < strlen(s);j++)
+ // ^^ this skips over the first character of a word, which
+ // is ALWAYS part of the word
+ // this is safe since if i+1 == strlen(s), i will become
+ // strlen(s)-1 at the end of this block and the function
+ // will terminate. A space can't be the first character we
+ // read here, and neither can a \n be the start, since these
+ // two cases have been handled above.
{
c = substring(s, j, 1);
if (c == " ")
More information about the nexuiz-commits
mailing list