[PATCH 05/19] util: make virMacAddrParse more versatile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
index 612a409..7afe032 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;
-- 
2.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux