]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix strstrofs with unicode
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Feb 2010 20:32:24 +0000 (20:32 +0000)
committerRudolf Polzer <rpolzer@grawp.div0.qc.to>
Sat, 27 Feb 2010 14:56:13 +0000 (15:56 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10015 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=7310ccc56ef9562bac8d52df25ed47b826c02a49

prvm_cmds.c

index bd6b426ac236425423aa60e2d494c201d206ae84..8a21e93ca515c217fe4e11ca3479381687f43205 100644 (file)
@@ -5056,7 +5056,7 @@ void VM_strstrofs (void)
        if (!match)
                PRVM_G_FLOAT(OFS_RETURN) = -1;
        else
-               PRVM_G_FLOAT(OFS_RETURN) = match - instr;
+               PRVM_G_FLOAT(OFS_RETURN) = u8_strnlen(instr, match-instr);
 }
 
 //#222 string(string s, float index) str2chr (FTE_STRINGS)