/* Display an arbitrary length MAC address in readable format.  */
char* iw_mac_ntop(const unsigned char *mac, int maclen, char *buf, int buflen)
/* Display an arbitrary length MAC address in readable format.  */
char* iw_mac_ntop(const unsigned char *mac, int maclen, char *buf, int buflen)
{
  int	i;
  if(buflen < (maclen * 3 - 1 + 1))
    return(NULL);
  sprintf(buf, "%02X", mac[0]);
  for(i = 1; i < maclen; i++)
    sprintf(buf + (i * 3) - 1, ":%02X", mac[i]);
  return(buf);
}