fixed SourceMM crashing on long paths (steam srcds)
authorDavid Anderson <dvander@alliedmods.net>
Sat Jan 27 09:18:17 2007 +0000 (2007-01-27)
changeset 278614ea295cd25
parent 277 a50090ca6e6a
child 279 4836de1350c5
fixed SourceMM crashing on long paths (steam srcds)
sourcemm/CSmmAPI.cpp
sourcemm/sourcemm.cpp
sourcemm/version.rc
     1.1 --- a/sourcemm/CSmmAPI.cpp	Mon Dec 18 22:15:04 2006 +0000
     1.2 +++ b/sourcemm/CSmmAPI.cpp	Sat Jan 27 09:18:17 2007 +0000
     1.3 @@ -414,6 +414,11 @@
     1.4  	size_t mylen = vsnprintf(buffer, len, fmt, ap);
     1.5  	va_end(ap);
     1.6  
     1.7 +	if (mylen == 0xFFFFFFFF || mylen >= len)
     1.8 +	{
     1.9 +		mylen = len - 1;
    1.10 +	}
    1.11 +
    1.12  	for (size_t i=0; i<mylen; i++)
    1.13  	{
    1.14  		if (buffer[i] == ALT_SEP_CHAR)
     2.1 --- a/sourcemm/sourcemm.cpp	Mon Dec 18 22:15:04 2006 +0000
     2.2 +++ b/sourcemm/sourcemm.cpp	Sat Jan 27 09:18:17 2007 +0000
     2.3 @@ -511,7 +511,7 @@
     2.4  		return -1;
     2.5  	}
     2.6  
     2.7 -	char buffer[255], error[255], full_path[128];
     2.8 +	char buffer[255], error[255], full_path[255];
     2.9  	const char *ptr, *ext, *file;
    2.10  	size_t length;
    2.11  	while (!feof(fp))
     3.1 --- a/sourcemm/version.rc	Mon Dec 18 22:15:04 2006 +0000
     3.2 +++ b/sourcemm/version.rc	Sat Jan 27 09:18:17 2007 +0000
     3.3 @@ -1,6 +1,5 @@
     3.4  // Microsoft Visual C++ generated resource script.
     3.5  //
     3.6 -#include "resource.h"
     3.7  
     3.8  #define APSTUDIO_READONLY_SYMBOLS
     3.9  /////////////////////////////////////////////////////////////////////////////