I used the code from before the utf8 changed but it used to allow to access invalid...
authorblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jan 2010 20:12:41 +0000 (20:12 +0000)
committerblub <blub@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 5 Jan 2010 20:12:41 +0000 (20:12 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9794 d7cf8633-e32d-0410-b094-e92efae38249

prvm_cmds.c

index 7ec33ea..9730449 100644 (file)
@@ -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