networking/interface.c: remove superfluous "& 0377"

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-09-12 17:54:28 +02:00
parent b278ac0e60
commit b5a0396716

View File

@ -223,7 +223,7 @@ static char* FAST_FUNC UNSPEC_print(unsigned char *ptr)
pos = buff; pos = buff;
for (i = 0; i < sizeof(struct sockaddr); i++) { for (i = 0; i < sizeof(struct sockaddr); i++) {
/* careful -- not every libc's sprintf returns # bytes written */ /* careful -- not every libc's sprintf returns # bytes written */
sprintf(pos, "%02X-", (*ptr++ & 0377)); sprintf(pos, "%02X-", *ptr++);
pos += 3; pos += 3;
} }
/* Erase trailing "-". Works as long as sizeof(struct sockaddr) != 0 */ /* Erase trailing "-". Works as long as sizeof(struct sockaddr) != 0 */
@ -704,8 +704,7 @@ static char* FAST_FUNC ether_print(unsigned char *ptr)
{ {
char *buff; char *buff;
buff = xasprintf("%02X:%02X:%02X:%02X:%02X:%02X", buff = xasprintf("%02X:%02X:%02X:%02X:%02X:%02X",
(ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]
(ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
); );
return auto_string(buff); return auto_string(buff);
} }