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.
This commit is contained in:
Laine Stump 2017-03-08 15:27:05 -05:00
parent 606a013395
commit 30b07a425d

View 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;