From 6104f8b905f3ca719d6d5ae97757d76731658ccf Mon Sep 17 00:00:00 2001 From: Michael Mikonos Date: Mon, 23 Oct 2023 16:20:49 +0800 Subject: [PATCH] Str2I64: allow single "+" or "-" prefix before number --- src/Kernel/StrScan.ZC | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Kernel/StrScan.ZC b/src/Kernel/StrScan.ZC index 5dd2a2df..126e1317 100755 --- a/src/Kernel/StrScan.ZC +++ b/src/Kernel/StrScan.ZC @@ -13,18 +13,16 @@ I64 Str2I64(U8 *st, I64 radix=10, U8 **_end_ptr=NULL) } while (Bt(char_bmp_white_space, *st)) st++; + if (*st == '+') + st++; + else if (*st == '-') + { + neg = TRUE; + st++; + } while (TRUE) switch (*st) { - case '-': - st++; - neg = !neg; - break; - - case '+': - st++; - break; - case '0': st++; ch = ToUpper(*st);