From: Lei Xia Date: Tue, 13 Mar 2012 17:25:10 +0000 (-0500) Subject: fix a minor bug when converting MAC string to hexs X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=3e2eedc35f778c99cf0dd99f03dd9d78ba731041;p=palacios.git fix a minor bug when converting MAC string to hexs --- diff --git a/palacios/include/palacios/vmm_ethernet.h b/palacios/include/palacios/vmm_ethernet.h index c4725a9..b141a59 100644 --- a/palacios/include/palacios/vmm_ethernet.h +++ b/palacios/include/palacios/vmm_ethernet.h @@ -102,9 +102,10 @@ static inline int compare_ether_hdr(const uint8_t * hdr1, const uint8_t * hdr2) /* AA:BB:CC:DD:EE:FF */ static inline int str2mac(char * macstr, uint8_t * mac){ - char hex[2], *s = macstr; + char hex[3], *s = macstr; int i = 0; + hex[2] = 0; while(s){ memcpy(hex, s, 2); mac[i++] = (char)atox(hex);