From b65b723fa6c3594555289c681c08e5c52eac21cd Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 31 Aug 2020 15:37:19 -0400 Subject: [PATCH] Resolve #554: STRSUB("", N, 0) will not warn "Position N is past the end of the string" --- src/asm/asmy.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asm/asmy.y b/src/asm/asmy.y index 0cfcfc3f..89f50fe8 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -461,7 +461,7 @@ static void strsubUTF8(char *dest, const char *src, uint32_t pos, uint32_t len) srcIndex++; } - if (!src[srcIndex]) + if (!src[srcIndex] && len) warning(WARNING_BUILTIN_ARG, "STRSUB: Position %lu is past the end of the string", (unsigned long)pos);