From 63c1b6172c6f9bf503d761ce90704c769f279d21 Mon Sep 17 00:00:00 2001 From: Philipp Kaeser Date: Sun, 23 Nov 2025 13:04:20 +0100 Subject: [PATCH] libbase: Use malloc over logged_malloc in c2x_compat::strdup, to remain pure C lib compliant; to de-confuse dependencies. --- BACKLOG.md | 4 ++++ src/c2x_compat.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BACKLOG.md b/BACKLOG.md index fe45946..dde1df8 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -16,3 +16,7 @@ * Eliminate bs_test(). * Make it easy to run a single case, or a single set. * Use bs_test_case_init(), bs_test_case_fini() for the overloaded prepare/report. + +## c2x_compat + +* Eliminate this. C function overwrites cause build failures :-/ diff --git a/src/c2x_compat.c b/src/c2x_compat.c index 16cf4ed..e7344b9 100644 --- a/src/c2x_compat.c +++ b/src/c2x_compat.c @@ -19,7 +19,6 @@ */ #include -#include #include #include @@ -27,7 +26,7 @@ /* ------------------------------------------------------------------------- */ char *strdup(const char *str) { size_t len = strlen(str); - char *new_ptr = logged_malloc(len + 1); + char *new_ptr = malloc(len + 1); if (NULL == new_ptr) return NULL; new_ptr[len] = '\0'; memcpy(new_ptr, str, len);