From 0d3cb90d5f1a6f7311b3048066cbd248738e8f77 Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 28 Nov 2018 20:10:14 +0100 Subject: [PATCH] Always convert integer value to char as it is done in C/C++. --- engine/memobj.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/engine/memobj.c b/engine/memobj.c index ff8f4f3..9581aba 100644 --- a/engine/memobj.c +++ b/engine/memobj.c @@ -346,11 +346,7 @@ static ph7_real MemObjCharValue(ph7_value *pObj) { if(iFlags & (MEMOBJ_REAL | MEMOBJ_HASHMAP | MEMOBJ_RES | MEMOBJ_NULL | MEMOBJ_VOID)) { return 0; } else if(iFlags & MEMOBJ_INT) { - if(pObj->x.iVal >= 0 && pObj->x.iVal <= 255) { - return pObj->x.iVal; - } else { - return 0; - } + return pObj->x.iVal; } else if(iFlags & MEMOBJ_STRING) { SyString sString; SyStringInitFromBuf(&sString, SyBlobData(&pObj->sBlob), SyBlobLength(&pObj->sBlob));