From: cloudwalk Date: Thu, 4 Jun 2020 17:32:18 +0000 (+0000) Subject: Fix ugly typo in a Z_Malloc X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=91ea11142922092f46a468484b9a14df25f02862;p=xonotic%2Fdarkplaces.git Fix ugly typo in a Z_Malloc It was allocating the size of the string starting from +2 offset rather than adding 2 bytes. Oops. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12637 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host.c b/host.c index 95b1025f..4fb4b287 100644 --- a/host.c +++ b/host.c @@ -1121,7 +1121,7 @@ static void Host_InitSession(void) Cvar_SetQuick(&sessionid, com_argv[i+1]); else { - buf = (char *)Z_Malloc(strlen(com_argv[i+1]+2)); + buf = (char *)Z_Malloc(strlen(com_argv[i+1]) + 2); dpsnprintf(buf, sizeof(buf), ".%s", com_argv[i+1]); Cvar_SetQuick(&sessionid, buf); }