aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoustaphaSaad <moustapha.saad.abdelhamed@gmail.com>2024-06-10 21:31:42 +0300
committerTheo Buehler <tb@openbsd.org>2024-06-19 14:06:09 +0200
commit71e574aa67c00ddefc9c59adb1f476af8697f640 (patch)
treea727f1fd67a4e89682709b5d4c1784a666a4333e
parent1b4bf24d88b2346ca83aaaf061817bd07b882fea (diff)
downloadportable-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.txt17
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)
221endif() 221endif()
222 222
223check_function_exists(strlcat HAVE_STRLCAT) 223# Emscripten's strlcat and strlcpy triggers ASAN errors
224if(HAVE_STRLCAT) 224if(NOT EMSCRIPTEN)
225 add_definitions(-DHAVE_STRLCAT) 225 check_function_exists(strlcat HAVE_STRLCAT)
226endif() 226 if(HAVE_STRLCAT)
227 add_definitions(-DHAVE_STRLCAT)
228 endif()
227 229
228check_function_exists(strlcpy HAVE_STRLCPY) 230 check_function_exists(strlcpy HAVE_STRLCPY)
229if(HAVE_STRLCPY) 231 if(HAVE_STRLCPY)
230 add_definitions(-DHAVE_STRLCPY) 232 add_definitions(-DHAVE_STRLCPY)
233 endif()
231endif() 234endif()
232 235
233check_function_exists(strndup HAVE_STRNDUP) 236check_function_exists(strndup HAVE_STRNDUP)