[lib] mac_bytes_to_string_r(): use snprintf()

Use snprintf() instead of sprintf() in mac_bytes_to_string_r(). This is
really useless, but I want to satisfy the snprintf BSD zealots and get
rid of the warning GCC gives me on OpenBSD.
This commit is contained in:
Matteo Cypriani 2011-06-23 17:38:08 +02:00
parent b3cfa2ea08
commit 35e787064b
1 changed files with 4 additions and 3 deletions

View File

@ -49,9 +49,10 @@ const char* owl_mac_bytes_to_string(const uint8_t *const mac_binary)
void owl_mac_bytes_to_string_r(const uint8_t *const mac_binary,
char mac_str[OWL_ETHER_ADDR_STRLEN])
{
sprintf(mac_str, "%02x:%02x:%02x:%02x:%02x:%02x",
mac_binary[0], mac_binary[1], mac_binary[2],
mac_binary[3], mac_binary[4], mac_binary[5]) ;
snprintf(mac_str, OWL_ETHER_ADDR_STRLEN,
"%02x:%02x:%02x:%02x:%02x:%02x",
mac_binary[0], mac_binary[1], mac_binary[2],
mac_binary[3], mac_binary[4], mac_binary[5]) ;
}