From: Andrea Bolognani Date: Fri, 20 Jul 2018 11:00:34 +0000 (+0200) Subject: src: Use virStrcpy() wherever possible X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dee35f6acfb354cabf6c818b10a61c47c2131cf7;p=libvirt.git src: Use virStrcpy() wherever possible virStrncpy() allows us to copy a substring, but if we're going to copy the entire thing it's much more convenient to use virStrcpy() instead. Signed-off-by: Andrea Bolognani --- diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 57ebd0ec03..017786ce43 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -2763,8 +2763,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntryPtr mcast) mcast->idx = num; break; case VIR_MCAST_TYPE_NAME_TOKEN: - if (virStrncpy(mcast->name, token, strlen(token), - VIR_MCAST_NAME_LEN) == NULL) { + if (virStrcpy(mcast->name, token, VIR_MCAST_NAME_LEN) == NULL) { virReportSystemError(EINVAL, _("Failed to parse network device name from '%s'"), buf);