fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit 62c26587315cddaeee6708d71f1bd892e24817ee
parent 267d5dbe4f79b8ebff8588700b2a8c0d1e56fc97
Author: jvoisin <julien.voisin@dustri.org>
Date:   Sun, 17 Sep 2023 16:23:50 +0200

Fix compilation under clang for bsd-specific functions

Diffstat:
Mtests/test_strlcat_dynamic_write.c | 2++
Mtests/test_strlcat_static_write.c | 2++
Mtests/test_strlcpy_dynamic_write.c | 2++
Mtests/test_strlcpy_static_write.c | 2++
4 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tests/test_strlcat_dynamic_write.c b/tests/test_strlcat_dynamic_write.c @@ -6,6 +6,7 @@ #include <string.h> int main(int argc, char** argv) { +#if !defined(__clang__) char buffer[8] = {0}; strlcat(buffer, "1234567", sizeof(buffer)); puts(buffer); @@ -15,5 +16,6 @@ int main(int argc, char** argv) { CHK_FAIL_END puts(buffer); +#endif return ret; } diff --git a/tests/test_strlcat_static_write.c b/tests/test_strlcat_static_write.c @@ -6,6 +6,7 @@ #include <string.h> int main(int argc, char** argv) { +#if !defined(__clang__) char buffer[8] = {0}; strlcat(buffer, "1234567", sizeof(buffer)); puts(buffer); @@ -15,5 +16,6 @@ int main(int argc, char** argv) { CHK_FAIL_END puts(buffer); +#endif return ret; } diff --git a/tests/test_strlcpy_dynamic_write.c b/tests/test_strlcpy_dynamic_write.c @@ -6,6 +6,7 @@ #include <string.h> int main(int argc, char** argv) { +#if !defined(__clang__) char buffer[8] = {0}; strlcpy(buffer, "1234567", sizeof(buffer)); puts(buffer); @@ -15,5 +16,6 @@ int main(int argc, char** argv) { CHK_FAIL_END puts(buffer); +#endif return ret; } diff --git a/tests/test_strlcpy_static_write.c b/tests/test_strlcpy_static_write.c @@ -6,6 +6,7 @@ #include <string.h> int main(int argc, char** argv) { +#if !defined(__clang__) char buffer[8] = {0}; strlcpy(buffer, "1234567", sizeof(buffer)); puts(buffer); @@ -15,5 +16,6 @@ int main(int argc, char** argv) { CHK_FAIL_END puts(buffer); +#endif return ret; }