From 69ea45cc014e8a318361123bdc883175f7e965fe Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Mon, 21 Sep 2020 20:32:05 +0200 Subject: [PATCH] + fix: interpretation of '%' operator: allow "(...)" on rhs of modulo interpretation --- src/tinyexpr/tinyexpr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tinyexpr/tinyexpr.c b/src/tinyexpr/tinyexpr.c index 81f868df2..7553f1758 100644 --- a/src/tinyexpr/tinyexpr.c +++ b/src/tinyexpr/tinyexpr.c @@ -147,8 +147,8 @@ static inline bool isNextCharNumber(const state* s) if (*ch == ' ') { ++ch; continue; } - // ASCII 0-9 -> [48,57] - else if ((*ch > 47) && (*ch < 58)) { + // ASCII 0-9 -> [48,57] or '(' + else if (((*ch > 47) && (*ch < 58)) || (*ch == 40)) { return true; } // no number