summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/string.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/string.cpp b/src/string.cpp
index 7557f6d1d..b543ab868 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -560,10 +560,9 @@ size_t Utf8TrimString(char *s, size_t maxlen)
}
#ifdef DEFINE_STRNDUP
-#include "core/math_func.hpp"
char *strndup(const char *s, size_t len)
{
- len = min(strlen(s), len);
+ len = ttd_strnlen(s, len);
char *tmp = CallocT<char>(len + 1);
memcpy(tmp, s, len);
return tmp;