{
unsigned char *p;
int i;
- char *buf, *oldbuf = NULL;
+ char *buf = NULL;
ulog_iret_t *ret = ip->result;
if (pkt->mac_len) {
*buf = '\0';
p = pkt->mac;
- oldbuf = buf;
for (i = 0; i < pkt->mac_len; i++, p++)
- sprintf(buf, "%s%02x%c", oldbuf, *p, i==pkt->mac_len-1 ? ' ':':');
+ sprintf(buf + (i*3), "%02x%c", *p, i==pkt->mac_len-1 ? ' ':':');
ret[0].value.ptr = buf;
ret[0].flags |= ULOGD_RETF_VALID;
}