From 39518eb3c1c2e5eb1ba287f65aeb24c35cdc6d4b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 18 May 2014 10:44:51 +0100 Subject: fix possible buffer termination error (coverity 1195410) --- utils/utf8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/utf8.c') diff --git a/utils/utf8.c b/utils/utf8.c index a6282dbba..a8e3e5de8 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -237,8 +237,8 @@ utf8_convert(const char *string, iconv_close(last_cd.cd); /* and copy the to/from/cd data into last_cd */ - strncpy(last_cd.from, from, sizeof(last_cd.from)); - strncpy(last_cd.to, to, sizeof(last_cd.to)); + snprintf(last_cd.from, sizeof(last_cd.from), "%s", from); + snprintf(last_cd.to, sizeof(last_cd.to), "%s", to); last_cd.cd = cd; } -- cgit v1.2.3