[rott-commits] r261 - trunk/rott

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Nov 7 04:13:46 EST 2011


Author: fabian
Date: 2011-11-07 04:13:45 -0500 (Mon, 07 Nov 2011)
New Revision: 261

Modified:
   trunk/rott/rt_net.c
Log:
Use strlen() instead of sizeof()-1

Modified: trunk/rott/rt_net.c
===================================================================
--- trunk/rott/rt_net.c	2011-06-08 12:34:21 UTC (rev 260)
+++ trunk/rott/rt_net.c	2011-11-07 09:13:45 UTC (rev 261)
@@ -3079,8 +3079,8 @@
 {
    strcpy(filename,DATADIR "DEMO0_0.DMO\0");
 
-   filename[3 + sizeof(DATADIR)] = (char)('0' + (byte)demonumber);
-   filename[5 + sizeof(DATADIR)] = (char)('0' + (byte)gamestate.violence);
+   filename[4 + strlen(DATADIR)] = (char)('0' + (byte)demonumber);
+   filename[6 + strlen(DATADIR)] = (char)('0' + (byte)gamestate.violence);
    FixFilePath(filename);
 }
 //****************************************************************************



More information about the rott-commits mailing list