check for negative value in ptr_lstrip() (#988)

* check for negative value in ptr_lstrip()

This fixes parsing of DEHACKED in D2ISOv2.wad with debug version of CRT. If the
value < 0 the behavior of `isspace()` is undefined according to the
documentation.

* disable vcpkg update
This commit is contained in:
Roman Fomin 2023-04-13 06:36:08 +07:00 committed by GitHub
parent 7ad722e845
commit 3f4ba9f388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3137,7 +3137,7 @@ void rstrip(char *s) // strip trailing whitespace
// //
char *ptr_lstrip(char *p) // point past leading whitespace char *ptr_lstrip(char *p) // point past leading whitespace
{ {
while (isspace(*p)) while (*p >= 0 && isspace(*p))
p++; p++;
return p; return p;
} }