From: blub Date: Tue, 5 Jan 2010 20:12:41 +0000 (+0000) Subject: I used the code from before the utf8 changed but it used to allow to access invalid... X-Git-Tag: xonotic-v0.1.0preview~230^2~673 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=04b9f2c16039ab05fee8cf6de193eabd04202103 I used the code from before the utf8 changed but it used to allow to access invalid memory - fixed that git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9794 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_cmds.c b/prvm_cmds.c index 7ec33eac..97304495 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -5060,7 +5060,7 @@ void VM_str2chr (void) if (utf8_enable.integer) ch = u8_getchar_noendptr(s + index); else - ch = (unsigned char)s[(unsigned)PRVM_G_FLOAT(OFS_PARM1)]; + ch = (unsigned char)s[index]; PRVM_G_FLOAT(OFS_RETURN) = ch; } else