shithub: rgbds

Download patch

ref: d2801505c33c69bcd96a49ef2e7406a883bcd57e
parent: 9d62b4b9bbff03398bfb44a05195e09aa246392b
parent: b65b723fa6c3594555289c681c08e5c52eac21cd
author: Eldred Habert <eldredhabert0@gmail.com>
date: Thu Sep 3 08:12:03 EDT 2020

Merge pull request #562 from Rangi42/strsub-0

Resolve #554: STRSUB("<N-char string>", N, 0) will not warn "Position N is past the end of the string"

--- a/src/asm/asmy.y
+++ b/src/asm/asmy.y
@@ -461,7 +461,7 @@
 		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);