- Fixed: The sidedef loader could allocate insufficient memory if a map

contained unused sidedefs.
- Fixed: Color control sequences were written to the log file. Since any
  entered console command contains such a sequence it was quite noticable.

SVN r208 (trunk)
This commit is contained in:
Christoph Oelckers 2006-06-21 15:40:42 +00:00
commit 14765bf64b
3 changed files with 27 additions and 4 deletions

View file

@ -811,7 +811,27 @@ int PrintString (int printlevel, const char *outline)
if (Logfile)
{
fputs (outline, Logfile);
// Strip out any color escape sequences before writing to the log file
char * copy = new char[strlen(outline)+1];
const char * srcp = outline;
char * dstp = copy;
while (*srcp != 0)
{
if (*srcp!=0x1c)
{
*dstp++=*srcp++;
}
else
{
if (srcp[1]!=0) srcp+=2;
else break;
}
}
*dstp=0;
fputs (copy, Logfile);
delete [] copy;
//#ifdef _DEBUG
fflush (Logfile);
//#endif