From 960195482505a5d3facf15fbfb61817b11e9a08c Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Wed, 21 Aug 2019 11:36:40 +0200 Subject: [PATCH 1/1] Don't call strncpy with mismatching length MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes "vcard.c:238:2: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length" --- src/vcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vcard.c b/src/vcard.c index 463f4a35d..2e8fce511 100644 --- a/src/vcard.c +++ b/src/vcard.c @@ -235,7 +235,7 @@ static gchar *vcard_get_line( VCardFile *cardFile ) { start = cardFile->bufptr; len = strlen( start ); end = start + len; - strncpy( buf, start, len ); + memcpy( buf, start, len ); buf[ len ] = '\0'; g_strstrip(buf); cardFile->bufptr = end + 1; -- 2.25.1