summaryrefslogtreecommitdiff
path: root/tests/usbg-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/usbg-test.c')
-rw-r--r--tests/usbg-test.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/usbg-test.c b/tests/usbg-test.c
index e480ca9..c332795 100644
--- a/tests/usbg-test.c
+++ b/tests/usbg-test.c
@@ -1089,21 +1089,18 @@ static void pull_function_net_attrs(struct test_function *func, usbg_f_net_attrs
{
char *path;
char *content;
- size_t len;
safe_asprintf(&path, "%s/%s/dev_addr", func->path, func->name);
- len = ETHER_ADDR_STR_LEN * sizeof(char);
-
- content = safe_malloc(len);
- usbg_ether_ntoa_r(&attrs->dev_addr, content, len);
+ content = safe_malloc(ETHER_ADDR_STR_LEN * sizeof(char));
+ usbg_ether_ntoa_r(&attrs->dev_addr, content);
EXPECT_WRITE(path, content);
safe_asprintf(&path, "%s/%s/host_addr", func->path, func->name);
- content = safe_malloc(len);
- usbg_ether_ntoa_r(&attrs->host_addr, content, len);
+ content = safe_malloc(ETHER_ADDR_STR_LEN * sizeof(char));
+ usbg_ether_ntoa_r(&attrs->host_addr, content);
EXPECT_WRITE(path, content);