From f1b04c40ba9faf9b7b8969cf3686c35bb7b79b33 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 6 Aug 2024 14:15:07 +0200 Subject: Use dStrdup instead of strdup The strdup function is not available in POSIX-2001, so we use our own implementation in dlib: dStrdup. Reviewed-by: dogma --- lout/misc.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lout/misc.hh') diff --git a/lout/misc.hh b/lout/misc.hh index 80f227f8..1108c1eb 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -6,6 +6,7 @@ #include #include #include +#include "dlib/dlib.h" namespace lout { @@ -586,7 +587,7 @@ public: * A copy is kept in the buffer, so the caller does not have to care * about memory management. */ - inline void append(const char *str) { appendNoCopy(strdup(str)); } + inline void append(const char *str) { appendNoCopy(dStrdup(str)); } inline void appendInt(int n) { char buf[32]; sprintf (buf, "%d", n); append (buf); } inline void appendPointer(void *p) -- cgit v1.2.3