mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
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"
This commit is contained in:
@@ -461,7 +461,7 @@ static void strsubUTF8(char *dest, const char *src, uint32_t pos, uint32_t len)
|
|||||||
srcIndex++;
|
srcIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src[srcIndex])
|
if (!src[srcIndex] && len)
|
||||||
warning(WARNING_BUILTIN_ARG, "STRSUB: Position %lu is past the end of the string",
|
warning(WARNING_BUILTIN_ARG, "STRSUB: Position %lu is past the end of the string",
|
||||||
(unsigned long)pos);
|
(unsigned long)pos);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user