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 <abologna@redhat.com>
This commit is contained in:
Andrea Bolognani 2018-07-20 13:00:34 +02:00
parent 5d481d0d02
commit dee35f6acf

View File

@ -2763,8 +2763,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntryPtr mcast)
mcast->idx = num; mcast->idx = num;
break; break;
case VIR_MCAST_TYPE_NAME_TOKEN: case VIR_MCAST_TYPE_NAME_TOKEN:
if (virStrncpy(mcast->name, token, strlen(token), if (virStrcpy(mcast->name, token, VIR_MCAST_NAME_LEN) == NULL) {
VIR_MCAST_NAME_LEN) == NULL) {
virReportSystemError(EINVAL, virReportSystemError(EINVAL,
_("Failed to parse network device name from '%s'"), _("Failed to parse network device name from '%s'"),
buf); buf);