提交 dee35f6a 编写于 作者: A Andrea Bolognani

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: NAndrea Bolognani <abologna@redhat.com>
上级 5d481d0d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册