[libmodplug] use static cast for ctype

This commit is contained in:
aybe 2019-11-23 10:20:18 +01:00
parent 7ca7db5285
commit 1f49837376
3 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,14 @@
diff --git a/src/load_abc.cpp b/src/load_abc.cpp
index ee79f39..874ab8f 100644
--- a/src/load_abc.cpp
+++ b/src/load_abc.cpp
@@ -268,7 +268,8 @@ static void setenv(const char *name, const char *value, int overwrite)
#endif
static int abc_isvalidchar(char c) {
- return(isalpha(c) || isdigit(c) || isspace(c) || c == '%' || c == ':');
+ unsigned char u = static_cast<unsigned char>(c);
+ return(isalpha(u) || isdigit(u) || isspace(u) || c == '%' || c == ':');
}
#if 0
static const char *abc_skipspace(const char *p)

View File

@ -1,4 +1,4 @@
Source: libmodplug Source: libmodplug
Version: 0.8.9.0-4 Version: 0.8.9.0-5
Homepage: https://github.com/Konstanty/libmodplug Homepage: https://github.com/Konstanty/libmodplug
Description: The ModPlug mod file playing library. Description: The ModPlug mod file playing library.

View File

@ -11,6 +11,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
PATCHES PATCHES
"001-automagically-define-modplug-static.patch" "001-automagically-define-modplug-static.patch"
"002-detect_sinf.patch" "002-detect_sinf.patch"
"003-use-static-cast-for-ctype.patch"
) )
else() else()
vcpkg_from_github(ARCHIVE vcpkg_from_github(ARCHIVE
@ -20,6 +21,7 @@ else()
SHA512 c43bb3190b62c3a4e3636bba121b5593bbf8e6577ca9f2aa04d90b03730ea7fb590e640cdadeb565758b92e81187bc456e693fe37f1f4deace9b9f37556e3ba1 SHA512 c43bb3190b62c3a4e3636bba121b5593bbf8e6577ca9f2aa04d90b03730ea7fb590e640cdadeb565758b92e81187bc456e693fe37f1f4deace9b9f37556e3ba1
PATCHES PATCHES
"002-detect_sinf.patch" "002-detect_sinf.patch"
"003-use-static-cast-for-ctype.patch"
) )
endif() endif()