From ef1a55ff9caa30c9084120c24b70994ec394ebb2 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 14 May 2013 13:01:52 +0000 Subject: [PATCH] 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 --- engine/common/pr_bgcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index 8a433fa67..8c2448e19 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -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