Skip to content

Commit 93c55e3

Browse files
committed
Cast byte to unsigned int before %x
1 parent cea2a7b commit 93c55e3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/arping.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,9 @@ getclock(struct timespec *ts)
999999
static char*
10001000
format_mac(const unsigned char* mac, char* buf, size_t bufsize) {
10011001
xsnprintf(buf, bufsize, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",
1002-
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
1002+
(unsigned)mac[0], (unsigned)mac[1],
1003+
(unsigned)mac[2], (unsigned)mac[3],
1004+
(unsigned)mac[4], (unsigned)mac[5]);
10031005
return buf;
10041006
}
10051007

0 commit comments

Comments
 (0)