From d9292cfefb42fbb18335bac907074744c7295a65 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 2 Apr 2010 14:57:01 -0400 Subject: [PATCH] The attached patch optimizes the validation of the name of an interface. --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }