From 2d3dc13f481bd6a5dfc16511f7df89903b69c4fd Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Wed, 26 Mar 2014 16:42:26 +0100 Subject: Fixed: all possible malloc, sprintf and strcpy problems Signed-off-by: Alexander Wenzel --- src/tests/dlt-test-multi-process.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tests/dlt-test-multi-process.c') diff --git a/src/tests/dlt-test-multi-process.c b/src/tests/dlt-test-multi-process.c index be5431b..bb81cb3 100755 --- a/src/tests/dlt-test-multi-process.c +++ b/src/tests/dlt-test-multi-process.c @@ -94,7 +94,7 @@ unsigned int pidcount = 0; void usage(char *prog_name) { char version[255]; - dlt_get_version(version); + dlt_get_version(version,255); s_parameters defaults; init_params(&defaults); @@ -298,8 +298,8 @@ void do_logging(s_thread_data *data) char ctid_name[256]; - sprintf(ctid,"%.2x", rand() & 0x0000ffff); - sprintf(ctid_name, "Child %s in dlt-test-multi-process", ctid); + snprintf(ctid,5,"%.2x", rand() & 0x0000ffff); + snprintf(ctid_name,256, "Child %s in dlt-test-multi-process", ctid); DLT_REGISTER_CONTEXT(mycontext, ctid, ctid_name); int msgs_left = data->params.nmsgs; @@ -324,8 +324,8 @@ void run_threads(s_parameters params) srand(getpid()); - sprintf(apid,"MT%02u", pidcount); - sprintf(apid_name, "Apps %s.", apid); + snprintf(apid,5,"MT%02u", pidcount); + snprintf(apid_name,256, "Apps %s.", apid); DLT_REGISTER_APP(apid, apid_name); -- cgit v1.2.1