summaryrefslogtreecommitdiff
path: root/lout/object.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-08-06 14:15:07 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-08-07 16:50:56 +0200
commitf1b04c40ba9faf9b7b8969cf3686c35bb7b79b33 (patch)
tree9e37bde60e1aa7ee17bcd00fe77e5c48151ff224 /lout/object.cc
parent83e88446c99f793f696984904e47070a287fd15d (diff)
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
Diffstat (limited to 'lout/object.cc')
-rw-r--r--lout/object.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lout/object.cc b/lout/object.cc
index e4e0152a..5c2ee433 100644
--- a/lout/object.cc
+++ b/lout/object.cc
@@ -20,6 +20,7 @@
#include "object.hh"
+#include "dlib/dlib.h"
#include <stdio.h>
#include <stdint.h>
#include <config.h>
@@ -83,7 +84,7 @@ const char *Object::toString()
/** \todo garbage! */
misc::StringBuffer sb;
intoStringBuffer(&sb);
- char *s = strdup(sb.getChars());
+ char *s = dStrdup(sb.getChars());
return s;
}
@@ -291,7 +292,7 @@ void ConstString::intoStringBuffer(misc::StringBuffer *sb)
// String
// ------------
-String::String (const char *str): ConstString (str ? strdup(str) : NULL)
+String::String (const char *str): ConstString (str ? dStrdup(str) : NULL)
{
}