From 91ea11142922092f46a468484b9a14df25f02862 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Thu, 4 Jun 2020 17:32:18 +0000 Subject: [PATCH] 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 --- host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.39.2