From: Stefan Berger Date: Fri, 2 Apr 2010 18:57:01 +0000 (-0400) Subject: The attached patch optimizes the validation of the name of an interface. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d9292cfefb42fbb18335bac907074744c7295a65;p=libvirt.git The attached patch optimizes the validation of the name of an interface. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 067f053369..d6ba4f6a52 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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; }