From: divverent Date: Thu, 5 Mar 2015 12:27:18 +0000 (+0000) Subject: Fix rephrased altstr code. X-Git-Tag: xonotic-v0.8.1~8^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=704d101890948f0f496ce4fe73be523137c62117;p=xonotic%2Fdarkplaces.git Fix rephrased altstr code. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12203 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_cmds.c b/prvm_cmds.c index 332fe75b..ba832b81 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -4426,9 +4426,8 @@ string altstr_prepare(string) void VM_altstr_prepare(prvm_prog_t *prog) { const char *instr, *in; - int size; char outstr[VM_STRINGTEMP_LENGTH]; - int outpos; + size_t outpos; VM_SAFEPARMCOUNT( 1, VM_altstr_prepare ); @@ -4438,13 +4437,13 @@ void VM_altstr_prepare(prvm_prog_t *prog) { if (*in == '\'' && outpos < sizeof(outstr) - 2) { - out[outpos++] = '\\'; - out[outpos++] = '\''; + outstr[outpos++] = '\\'; + outstr[outpos++] = '\''; } else - out[outpos++] = *in; + outstr[outpos++] = *in; } - out[outpos++] = 0; + outstr[outpos] = 0; PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString(prog, outstr ); }