From 2fcae1f9fc32efbc1cd2eb08a2fbefd0fadcb190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Tvrd=C3=ADk?= Date: Mon, 2 Nov 2015 13:28:15 +0100 Subject: [PATCH] Birdtest: do not use strcpy() --- test/birdtest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/birdtest.h b/test/birdtest.h index c5170ff9..1bed6f92 100644 --- a/test/birdtest.h +++ b/test/birdtest.h @@ -151,7 +151,7 @@ void bt_strncat_(char *buf, size_t buf_size, const char *str, ...); do \ { \ char buf[BT_BUFFER_SIZE]; \ - strcpy(buf, ""); \ + bzero(buf, sizeof(buf)); \ snprintf(buf, sizeof(buf), "%s(", #fn); \ bt_dump(buf, in, in_fmt); \ bt_strncat(buf, ") gives "); \ @@ -209,7 +209,7 @@ void bt_strncat_(char *buf, size_t buf_size, const char *str, ...); for (i = 0; i < (sizeof(in_out)/sizeof(in_out[0])); i++) \ { \ typeof(in_out[i].out) fn_out; \ - memset(&fn_out, '\0', sizeof(fn_out)); \ + bzero(&fn_out, sizeof(fn_out)); \ fn(in_out[i].in, &fn_out); \ int single_test_case_success = !memcmp(&fn_out, &in_out[i].out, sizeof(in_out[i].out)); \ if (!single_test_case_success) \