From 12a9aa100420e4b64142b2d4f6efdc365d3bcb25 Mon Sep 17 00:00:00 2001 From: sezero Date: Mon, 30 Aug 2010 02:51:21 +0000 Subject: [PATCH] fixed lazy declaration and cleaned up the .bsp extension removal logic. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@315 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/host_cmd.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Quake/host_cmd.c b/Quake/host_cmd.c index 8d411d90..b60cd45f 100644 --- a/Quake/host_cmd.c +++ b/Quake/host_cmd.c @@ -792,7 +792,7 @@ command from the console. Active clients are kicked off. void Host_Map_f (void) { int i; - char name[MAX_QPATH]; + char name[MAX_QPATH], *p; if (Cmd_Argc() < 2) //no map name given { @@ -828,17 +828,11 @@ void Host_Map_f (void) SCR_BeginLoadingPlaque (); svs.serverflags = 0; // haven't completed an episode yet - + strcpy (name, Cmd_Argv(1)); // remove (any) trailing ".bsp" from mapname S.A. - - char mapname[64], *needle; - strcpy (mapname, Cmd_Argv(1)); - - needle = strstr(mapname,".bsp"); - if (needle && (needle + 4 == mapname + Q_strlen(mapname))) - needle[0] = '\0'; - - strcpy (name, mapname); + p = strstr(name, ".bsp"); + if (p && p[4] == '\0') + *p = '\0'; SV_SpawnServer (name); if (!sv.active) return; @@ -1290,7 +1284,6 @@ void Host_Say(qboolean teamonly) client_t *save; int j, remquot = 0; const char *p; - // removed unsigned keyword -- kristian char text[MAXCMDLINE]; qboolean fromServer = false;