From: Laine Stump Date: Wed, 8 Mar 2017 20:27:05 +0000 (-0500) Subject: util: make virMacAddrParse more versatile X-Git-Tag: v3.2.0-rc1~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30b07a425d7b5b3ac7ca68d3574692ac6415ccbe;p=thirdparty%2Flibvirt.git util: make virMacAddrParse more versatile 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. --- diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c index 612a409d0b..7afe032b9c 100644 --- a/src/util/virmacaddr.c +++ b/src/util/virmacaddr.c @@ -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;