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