make sure str2chr always returns a positive value.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4369 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
5086f30e79
commit
ef1a55ff9c
1 changed files with 1 additions and 1 deletions
|
@ -2165,7 +2165,7 @@ void QCBUILTIN PF_str2chr (pubprogfuncs_t *prinst, struct globalvars_s *pr_globa
|
|||
if (ofs && (ofs < 0 || ofs > strlen(instr)))
|
||||
G_FLOAT(OFS_RETURN) = '\0';
|
||||
else
|
||||
G_FLOAT(OFS_RETURN) = VMUTF8?unicode_decode(NULL, instr+ofs, NULL):instr[ofs];
|
||||
G_FLOAT(OFS_RETURN) = VMUTF8?unicode_decode(NULL, instr+ofs, NULL):(unsigned char)instr[ofs];
|
||||
}
|
||||
|
||||
//FTE_STRINGS
|
||||
|
|
Loading…
Reference in a new issue