summaryrefslogtreecommitdiffstats
path: root/source/lib/util_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/util_str.c')
-rw-r--r--source/lib/util_str.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/lib/util_str.c b/source/lib/util_str.c
index c6b6570f5c4..6ebada94d71 100644
--- a/source/lib/util_str.c
+++ b/source/lib/util_str.c
@@ -1527,6 +1527,9 @@ int fstr_sprintf(fstring s, const char *fmt, ...)
/**
Some platforms don't have strndup.
**/
+#if defined(PARANOID_MALLOC_CHECKER)
+#undef strndup
+#endif
char *strndup(const char *s, size_t n)
{
@@ -1541,6 +1544,11 @@ int fstr_sprintf(fstring s, const char *fmt, ...)
return ret;
}
+
+#if defined(PARANOID_MALLOC_CHECKER)
+#define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY
+#endif
+
#endif
#if !defined(HAVE_STRNLEN) || defined(BROKEN_STRNLEN)