From 1d494420e5b97960ecaffd5f20d3a02af1713a3c Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 31 Jan 2020 19:58:08 +0200 Subject: [PATCH] Do not use whitespace eating functions when writing string to memory. --- debug.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/debug.cpp b/debug.cpp index a1682c53..7c61607d 100644 --- a/debug.cpp +++ b/debug.cpp @@ -518,19 +518,27 @@ static TCHAR readchar (TCHAR **c) (*c)++; return cc; } -static TCHAR next_char (TCHAR **c) +static TCHAR next_char(TCHAR **c) { ignore_ws (c); return *(*c)++; } +static TCHAR next_char2(TCHAR **c) +{ + return *(*c)++; +} static TCHAR peek_next_char (TCHAR **c) { TCHAR *pc = *c; return pc[1]; } -static int more_params (TCHAR **c) +static int more_params(TCHAR **c) +{ + ignore_ws(c); + return (**c) != 0; +} +static int more_params2(TCHAR **c) { - ignore_ws (c); return (**c) != 0; } @@ -3868,11 +3876,11 @@ static void writeintomem (TCHAR **c) uae_u32 addrb = addr; *c = cb; if (cc == '\'' || cc == '\"') { - next_char (c); - while (more_params (c)) { + next_char2(c); + while (more_params2(c)) { TCHAR str[2]; char *astr; - cc = next_char (c); + cc = next_char2(c); if (cc == '\'' || cc == '\"') break; str[0] = cc; -- 2.47.3