From de022dbf7573797f04ca48b2780adef122c1eda1 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 14 Oct 2018 21:37:57 +0200 Subject: Use memcpy instead of strncpy in append_log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re copying a known amount of bytes; strncpy is almost never the right solution. --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/util.c b/src/util.c index 04d0640d..5f4a4b7c 100644 --- a/src/util.c +++ b/src/util.c @@ -76,7 +76,7 @@ append_log(const char *s, size_t len) logbufsize = logbufsize + len + 1 + LOGBUFSIZ; logbuffer = x_realloc(logbuffer, logbufsize); } - strncpy(logbuffer + logsize, s, len); + memcpy(logbuffer + logsize, s, len); logsize += len; } -- cgit v1.2.1