diff options
author | MoustaphaSaad <moustapha.saad.abdelhamed@gmail.com> | 2024-06-10 21:31:42 +0300 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2024-06-19 14:06:09 +0200 |
commit | 71e574aa67c00ddefc9c59adb1f476af8697f640 (patch) | |
tree | a727f1fd67a4e89682709b5d4c1784a666a4333e | |
parent | 1b4bf24d88b2346ca83aaaf061817bd07b882fea (diff) | |
download | portable-71e574aa67c00ddefc9c59adb1f476af8697f640.tar.gz portable-71e574aa67c00ddefc9c59adb1f476af8697f640.tar.bz2 portable-71e574aa67c00ddefc9c59adb1f476af8697f640.zip |
use compat implementations of strlcpy and strlcat
strlcpy and strlcat Emscripten implementations cause ASAN errors. This commit disables strlcpy and strlcat detection and uses the compat implementations instead.
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 438e622..c496ad9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -220,14 +220,17 @@ if(HAVE_STRCASECMP) | |||
220 | add_definitions(-DHAVE_STRCASECMP) | 220 | add_definitions(-DHAVE_STRCASECMP) |
221 | endif() | 221 | endif() |
222 | 222 | ||
223 | check_function_exists(strlcat HAVE_STRLCAT) | 223 | # Emscripten's strlcat and strlcpy triggers ASAN errors |
224 | if(HAVE_STRLCAT) | 224 | if(NOT EMSCRIPTEN) |
225 | add_definitions(-DHAVE_STRLCAT) | 225 | check_function_exists(strlcat HAVE_STRLCAT) |
226 | endif() | 226 | if(HAVE_STRLCAT) |
227 | add_definitions(-DHAVE_STRLCAT) | ||
228 | endif() | ||
227 | 229 | ||
228 | check_function_exists(strlcpy HAVE_STRLCPY) | 230 | check_function_exists(strlcpy HAVE_STRLCPY) |
229 | if(HAVE_STRLCPY) | 231 | if(HAVE_STRLCPY) |
230 | add_definitions(-DHAVE_STRLCPY) | 232 | add_definitions(-DHAVE_STRLCPY) |
233 | endif() | ||
231 | endif() | 234 | endif() |
232 | 235 | ||
233 | check_function_exists(strndup HAVE_STRNDUP) | 236 | check_function_exists(strndup HAVE_STRNDUP) |