From 3d0fc33785a77238bc99ec807b1481338929b54f Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 28 Dec 2005 23:06:23 +0100 Subject: [PATCH] set_mem_comment(): Use memcpy() + NUL assignment instead of safe_strncpy() ... so as not to depend on util/string stuff. --- src/util/memdebug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/memdebug.c b/src/util/memdebug.c index 0262acb8e..44fa9c026 100644 --- a/src/util/memdebug.c +++ b/src/util/memdebug.c @@ -551,7 +551,8 @@ set_mem_comment(void *ptr, unsigned char *str, int len) ah->comment = malloc(len + 1); if (ah->comment) { - safe_strncpy(ah->comment, str, len + 1); + memcpy(ah->comment, str, len); + ah->comment[len] = 0; mem_stats.true_amount += len + 1; } }