From: Yuxuan Shui <yshui(a)codeweavers.com> wcschr(str, 0) returns the end of the string, not NULL. --- programs/cmd/batch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 28ecf917ed3..c5a0763c81f 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -387,7 +387,7 @@ void WCMD_HandleTildeModifiers(WCHAR **start, BOOL atExecute) BOOL doneModifier = FALSE; /* Search forwards until find invalid character modifier */ - for (; wcschr(validmodifiers, towlower(*lastModifier)); lastModifier = pos++) { + for (; *lastModifier && wcschr(validmodifiers, towlower(*lastModifier)); lastModifier = pos++) { /* Special case '$' to skip until : found */ if (*lastModifier == L'$') { if (!(pos = wcschr(pos, L':'))) return; /* Invalid syntax */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8543