Game Development Community

Bugfix: small crasher in console function getWords()

by Orion Elenzil · in Torque Game Engine · 11/20/2006 (12:45 pm) · 2 replies

Try the following:
echo(getWords("foo", 0, -1));

and you get a crash in tge 1.3 - tge 1.5.

the fix is simple:
consoleFunctions.cc
in static const char *getUnits(), find this line:
U32 totalSize = (U32(string - startString));
and right after it put these lines:
if (totalSize == 0)
      return "";

orion

#1
11/20/2006 (12:59 pm)
Lol, thanks Orion. I could almost guess it was you by the title.
#2
11/20/2006 (1:40 pm)
My pleasure! ;)