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-Tag: v0.8.0~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9292cfefb42fbb18335bac907074744c7295a65;p=thirdparty%2Flibvirt.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; }