r985 - in trunk/code: botlib client unix

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Nov 28 09:03:27 EST 2006


Author: tma
Date: 2006-11-28 09:03:27 -0500 (Tue, 28 Nov 2006)
New Revision: 985

Modified:
   trunk/code/botlib/l_precomp.c
   trunk/code/client/cl_main.c
   trunk/code/client/qal.c
   trunk/code/unix/unix_main.c
Log:
* Merge 954:955 from 1.34 branch


Modified: trunk/code/botlib/l_precomp.c
===================================================================
--- trunk/code/botlib/l_precomp.c	2006-11-28 05:51:05 UTC (rev 984)
+++ trunk/code/botlib/l_precomp.c	2006-11-28 14:03:27 UTC (rev 985)
@@ -469,9 +469,9 @@
 	strcat(token->string, "\"");
 	for (t = tokens; t; t = t->next)
 	{
-		strncat(token->string, t->string, MAX_TOKEN - strlen(token->string));
+		strncat(token->string, t->string, MAX_TOKEN - strlen(token->string) - 1);
 	} //end for
-	strncat(token->string, "\"", MAX_TOKEN - strlen(token->string));
+	strncat(token->string, "\"", MAX_TOKEN - strlen(token->string) - 1);
 	return qtrue;
 } //end of the function PC_StringizeTokens
 //============================================================================
@@ -1015,7 +1015,7 @@
 				break;
 			} //end if
 			if (token.type == TT_PUNCTUATION && *token.string == '>') break;
-			strncat(path, token.string, MAX_PATH);
+			strncat(path, token.string, MAX_PATH - 1);
 		} //end while
 		if (*token.string != '>')
 		{

Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2006-11-28 05:51:05 UTC (rev 984)
+++ trunk/code/client/cl_main.c	2006-11-28 14:03:27 UTC (rev 985)
@@ -2869,7 +2869,7 @@
 	Q_strncpyz( info, MSG_ReadString( msg ), MAX_INFO_STRING );
 	if (strlen(info)) {
 		if (info[strlen(info)-1] != '\n') {
-			strncat(info, "\n", sizeof(info));
+			strncat(info, "\n", sizeof(info) - 1);
 		}
 		Com_Printf( "%s: %s", NET_AdrToString( from ), info );
 	}

Modified: trunk/code/client/qal.c
===================================================================
--- trunk/code/client/qal.c	2006-11-28 05:51:05 UTC (rev 984)
+++ trunk/code/client/qal.c	2006-11-28 14:03:27 UTC (rev 985)
@@ -176,8 +176,8 @@
 #else
 		char fn[1024];
 		getcwd(fn, sizeof(fn));
-		strncat(fn, "/", sizeof(fn));
-		strncat(fn, libname, sizeof(fn));
+		strncat(fn, "/", sizeof(fn) - strlen(fn) - 1);
+		strncat(fn, libname, sizeof(fn) - strlen(fn) - 1);
 
 		if( (OpenALLib = OBJLOAD(fn)) == 0 )
 		{

Modified: trunk/code/unix/unix_main.c
===================================================================
--- trunk/code/unix/unix_main.c	2006-11-28 05:51:05 UTC (rev 984)
+++ trunk/code/unix/unix_main.c	2006-11-28 14:03:27 UTC (rev 985)
@@ -1236,7 +1236,7 @@
     if( msg[ i ] == '\n' )
     {
       Com_sprintf( tempBuffer, 7, "%c[0m\n", 0x1B );
-      strncat( buffer, tempBuffer, bufferSize );
+      strncat( buffer, tempBuffer, bufferSize - 1);
       i++;
     }
     else if( msg[ i ] == Q_COLOR_ESCAPE )
@@ -1258,7 +1258,7 @@
         if( escapeCode )
         {
           Com_sprintf( tempBuffer, 7, "%c[%sm", 0x1B, escapeCode );
-          strncat( buffer, tempBuffer, bufferSize );
+          strncat( buffer, tempBuffer, bufferSize - 1);
         }
 
         i++;
@@ -1267,7 +1267,7 @@
     else
     {
       Com_sprintf( tempBuffer, 7, "%c", msg[ i++ ] );
-      strncat( buffer, tempBuffer, bufferSize );
+      strncat( buffer, tempBuffer, bufferSize - 1);
     }
   }
 }




More information about the quake3-commits mailing list