summaryrefslogtreecommitdiff
path: root/src/tests/dlt-test-multi-process.c
diff options
context:
space:
mode:
authorAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2014-03-26 16:42:26 +0100
committerAlexander Wenzel <Alexander.AW.Wenzel@bmw.de>2014-04-01 10:21:04 +0200
commit2d3dc13f481bd6a5dfc16511f7df89903b69c4fd (patch)
tree6f0ffd297c7fc6c7b517784753455e2860bde8ec /src/tests/dlt-test-multi-process.c
parent8594f384fe8d622c20e7cb6091a2e99313e9830e (diff)
downloadDLT-daemon-2d3dc13f481bd6a5dfc16511f7df89903b69c4fd.tar.gz
Fixed: all possible malloc, sprintf and strcpy problems
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/tests/dlt-test-multi-process.c')
-rwxr-xr-xsrc/tests/dlt-test-multi-process.c10
1 files changed, 5 insertions, 5 deletions
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);