]> xenbits.xensource.com Git - libvirt.git/commitdiff
The attached patch optimizes the validation of the name of an interface.
authorStefan Berger <stefanb@us.ibm.com>
Fri, 2 Apr 2010 18:57:01 +0000 (14:57 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 2 Apr 2010 18:57:01 +0000 (14:57 -0400)
src/conf/domain_conf.c

index 067f053369d5d3bcd0a49532aaacee98073f8cfb..d6ba4f6a52272592a633723ac53d0a35820e207b 100644 (file)
@@ -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;
 }