mirror of https://gitee.com/openkylin/libvirt.git
The attached patch optimizes the validation of the name of an interface.
This commit is contained in:
parent
8459218cbc
commit
d9292cfefb
|
@ -1795,7 +1795,7 @@ cleanup:
|
|||
|
||||
static bool
|
||||
isValidIfname(const char *ifname) {
|
||||
return (strspn(ifname, VALID_IFNAME_CHARS) == strlen(ifname));
|
||||
return ifname[strspn(ifname, VALID_IFNAME_CHARS)] == 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue