ether-addr-util: drop redundant "addr" from struct hw_addr_data

Also, this makes always specifiy "struct" for hw_addr_data.
This commit is contained in:
Yu Watanabe
2021-06-10 00:19:50 +09:00
parent 91d0750dbf
commit ca2b7cd813
15 changed files with 55 additions and 57 deletions
+2 -2
View File
@@ -10,13 +10,13 @@
#include "macro.h"
#include "string-util.h"
char* hw_addr_to_string(const hw_addr_data *addr, char buffer[HW_ADDR_TO_STRING_MAX]) {
char* hw_addr_to_string(const struct hw_addr_data *addr, char buffer[HW_ADDR_TO_STRING_MAX]) {
assert(addr);
assert(buffer);
assert(addr->length <= HW_ADDR_MAX_SIZE);
for (size_t i = 0; i < addr->length; i++) {
sprintf(&buffer[3*i], "%02"PRIx8, addr->addr.bytes[i]);
sprintf(&buffer[3*i], "%02"PRIx8, addr->bytes[i]);
if (i < addr->length - 1)
buffer[3*i + 2] = ':';
}