From 95452a5a8a4848962e44fcbcefdfc41308e613d7 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 23 Oct 2016 19:47:33 +0000 Subject: [PATCH] C-CON and M32script: Only accept hex literals beginning with '0' and not any other digit. git-svn-id: https://svn.eduke32.com/eduke32@5908 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 2 +- polymer/eduke32/source/m32def.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index b14807a11..3ff24faac 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -2057,7 +2057,7 @@ static int32_t C_GetNextValue(int32_t type) BITPTR_CLEAR(g_scriptPtr-apScript); - if (tolower(textptr[1])=='x') + if (textptr[0] == '0' && tolower(textptr[1])=='x') *g_scriptPtr = parse_hex_constant(textptr+2); else *g_scriptPtr = parse_decimal_number(); diff --git a/polymer/eduke32/source/m32def.c b/polymer/eduke32/source/m32def.c index 42cfe2fee..a0cc49ff4 100644 --- a/polymer/eduke32/source/m32def.c +++ b/polymer/eduke32/source/m32def.c @@ -943,7 +943,7 @@ static int32_t GetGamearrayID(const char *szGameLabel, int32_t searchlocals) static int32_t parse_integer_literal(int32_t *num) { - if (tolower(textptr[1])=='x') + if (textptr[0] == '0' && tolower(textptr[1])=='x') sscanf(textptr+2, "%" SCNx32, num); else {