]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: make virMacAddrParse more versatile
authorLaine Stump <laine@laine.org>
Wed, 8 Mar 2017 20:27:05 +0000 (15:27 -0500)
committerLaine Stump <laine@laine.org>
Fri, 24 Mar 2017 04:37:01 +0000 (00:37 -0400)
Previously the MAC address text was required to be terminated with a
NULL. After this, it can be terminated with a space or any control
character.

src/util/virmacaddr.c

index 612a409d0b531c53215de360c22178d496876d4b..7afe032b9c8300bb98df2fabbc04ed1512c7d02e 100644 (file)
@@ -169,7 +169,7 @@ virMacAddrParse(const char* str, virMacAddrPtr addr)
 
         addr->addr[i] = (unsigned char) result;
 
-        if ((i == 5) && (*end_ptr == '\0'))
+        if ((i == 5) && (*end_ptr <= ' '))
             return 0;
         if (*end_ptr != ':')
             break;