commit aa8f4ad99713a23887cd2cce66e757ef0df941d6
parent bc5414861497db691bca5cd1a370a989689a3efd
Author: Ricardo Mones <ricardo@mones.org>
Date: Wed, 21 Aug 2019 11:36:40 +0200
Don't call strncpy with mismatching length
Fixes "vcard.c:238:2: warning: ‘strncpy’ output truncated before
terminating nul copying as many bytes from a string as its length"
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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;