From 326e719f0cbf89aed47135d805e689bbe79064e4 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Tue, 29 Nov 2016 18:22:38 +0100 Subject: [PATCH] Removed strndup from trace-example (not available on all platforms) --- plugins/trace/trace_example.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/trace/trace_example.c b/plugins/trace/trace_example.c index c22469a5..f4bdae90 100644 --- a/plugins/trace/trace_example.c +++ b/plugins/trace/trace_example.c @@ -230,7 +230,8 @@ static void trace_set_command(TRACE_INFO *info, char *buffer, size_t size) if (info->command) free(info->command); - info->command= strndup(buffer, size); + info->command= calloc(1, size + 1); + memcpy(info->command, buffer, size); } void dump_buffer(uchar *buffer, size_t len)