Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc index 81eccab..3c227ab 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc @@ -177,11 +177,26 @@ void etheraddr_string(register const u_char *ep, char *text) register char *cp; - char buf[sizeof("00:00:00:00:00:00")]; + char buf[sizeof("00:00:00:00:00:00\0")]; cp = buf; if ((j = *ep >> 4) != 0) + { *cp++ = hex[j]; + } + else + { + *cp++ = '0'; + } *cp++ = hex[*ep++ & 0xf]; - for (i = 5; (int)--i >= 0;) { + + for (i = 5; (int)--i >= 0;) + { *cp++ = ':'; if ((j = *ep >> 4) != 0) + { *cp++ = hex[j]; + } + else + { + *cp++ = '0'; + } + *cp++ = hex[*ep++ & 0xf]; |