All pastes #927492 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-04 10:18 UTC
rendered paste body
Index: src/bzflag/ServerStartMenu.cxx
===================================================================
--- src/bzflag/ServerStartMenu.cxx	(revision 16682)
+++ src/bzflag/ServerStartMenu.cxx	(working copy)
@@ -368,15 +368,17 @@
     char serverCmd[PATH_MAX + 256];
     strncpy(serverCmd, argv0, PATH_MAX+255);
     char* base = strrchr(serverCmd, '/');
-    int lenrem = PATH_MAX+256 - ((int)strlen(base)+1);
 
 #if defined(_WIN32)
     char* base2 = strrchr(serverCmd, '\\');
     if (base2 && (!base || base2 - serverCmd > base - serverCmd))
       base = base2;
 #endif
+
     if (!base) base = serverCmd;
     else base++;
+
+    int lenrem = PATH_MAX+256 - (base - serverCmd);
     strncpy(base, serverApp, lenrem-1);
 
     // prepare arguments for starting server