[quake3-commits] r1886 - trunk/code/game

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Feb 8 20:31:26 EST 2011


Author: thilo
Date: 2011-02-08 20:31:26 -0500 (Tue, 08 Feb 2011)
New Revision: 1886

Modified:
   trunk/code/game/bg_lib.c
Log:
Make Q_vsnprintf() more standard conform in bg_lib.c, patch by devhc


Modified: trunk/code/game/bg_lib.c
===================================================================
--- trunk/code/game/bg_lib.c	2011-02-09 00:42:54 UTC (rev 1885)
+++ trunk/code/game/bg_lib.c	2011-02-09 01:31:26 UTC (rev 1886)
@@ -1740,13 +1740,8 @@
       break; /* some picky compilers need this */
     }
   }
-  if (buffer != NULL)
-  {
-    if (currlen < maxlen - 1) 
-      buffer[currlen] = '\0';
-    else 
-      buffer[maxlen - 1] = '\0';
-  }
+  if (maxlen > 0)
+    buffer[currlen] = '\0';
   return total;
 }
 
@@ -2069,8 +2064,6 @@
 
 int Q_vsnprintf(char *str, size_t length, const char *fmt, va_list args)
 {
-	if (str != NULL)
-		str[0] = 0;
 	return dopr(str, length, fmt, args);
 }
 



More information about the quake3-commits mailing list