author | max <max> | 2002-12-08 16:26:16 (UTC) |
---|---|---|
committer | max <max> | 2002-12-08 16:26:16 (UTC) |
commit | a2840f80792c7e40ee3b44be0ec48302d8816cc0 (patch) (side-by-side diff) | |
tree | 21318df2f9611818f4a0fe501381b19ae753e493 /noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | |
parent | 5fd10ba0772bb87598a3f4fd2e0fff8c3d4dbe43 (diff) | |
download | opie-a2840f80792c7e40ee3b44be0ec48302d8816cc0.zip opie-a2840f80792c7e40ee3b44be0ec48302d8816cc0.tar.gz opie-a2840f80792c7e40ee3b44be0ec48302d8816cc0.tar.bz2 |
macaddress-fix
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/sniff.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/sniff.cc | 23 |
1 files changed, 19 insertions, 4 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 @@ -176,13 +176,28 @@ void etheraddr_string(register const u_char *ep, char *text) register unsigned int i, j; 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]; + { + *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]; + { + *cp++ = hex[j]; + } + else + { + *cp++ = '0'; + } + *cp++ = hex[*ep++ & 0xf]; } |