From: Rudolf Polzer Date: Thu, 27 Oct 2011 11:32:43 +0000 (+0200) Subject: fix missing strzoning in menu_cmd curl --cvar X-Git-Tag: xonotic-v0.6.0~35^2~78^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1206c2b84ba71de422578cb5d3d8a41027ab131a;p=xonotic%2Fxonotic-data.pk3dir.git fix missing strzoning in menu_cmd curl --cvar --- diff --git a/qcsrc/menu/gamecommand.qc b/qcsrc/menu/gamecommand.qc index e637bf5aa..ea2e4034e 100644 --- a/qcsrc/menu/gamecommand.qc +++ b/qcsrc/menu/gamecommand.qc @@ -45,12 +45,17 @@ void Curl_URI_Get_Callback(float id, float status, string data) if(status != 0) { print(sprintf(_("error: status is %d\n"), status)); + if(do_cvar) + strunzone(do_cvar); return; } if(do_exec) localcmd(data); if(do_cvar) + { cvar_set(do_cvar, data); + strunzone(do_cvar); + } if(!do_exec && !do_cvar) print(data); } @@ -137,7 +142,7 @@ void GameCommand(string theCommand) if(argv(i) == "--cvar" && i+2 < argc) { ++i; - do_cvar = argv(i); + do_cvar = strzone(argv(i)); continue; } if(argv(i) == "--exec")