Skip to content

Commit

Permalink
use compat implementations of strlcpy and strlcat
Browse files Browse the repository at this point in the history
strlcpy and strlcat Emscripten implementations cause ASAN errors. This commit disables strlcpy and strlcat detection and uses the compat implementations instead.
  • Loading branch information
MoustaphaSaad authored and botovq committed Jun 19, 2024
1 parent 1b4bf24 commit 71e574a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,17 @@ if(HAVE_STRCASECMP)
add_definitions(-DHAVE_STRCASECMP)
endif()

check_function_exists(strlcat HAVE_STRLCAT)
if(HAVE_STRLCAT)
add_definitions(-DHAVE_STRLCAT)
endif()
# Emscripten's strlcat and strlcpy triggers ASAN errors
if(NOT EMSCRIPTEN)
check_function_exists(strlcat HAVE_STRLCAT)
if(HAVE_STRLCAT)
add_definitions(-DHAVE_STRLCAT)
endif()

check_function_exists(strlcpy HAVE_STRLCPY)
if(HAVE_STRLCPY)
add_definitions(-DHAVE_STRLCPY)
check_function_exists(strlcpy HAVE_STRLCPY)
if(HAVE_STRLCPY)
add_definitions(-DHAVE_STRLCPY)
endif()
endif()

check_function_exists(strndup HAVE_STRNDUP)
Expand Down

0 comments on commit 71e574a

Please sign in to comment.