]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix ugly typo in a Z_Malloc
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 4 Jun 2020 17:32:18 +0000 (17:32 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 4 Jun 2020 17:32:18 +0000 (17:32 +0000)
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

diff --git a/host.c b/host.c
index 95b1025f1225c3e489f4f5ec1ea01f60db694ae2..4fb4b28731d63f7f6e2b296c68d8d7663f1b1895 100644 (file)
--- 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);
                }