From a33a1b2252cec68cdd4c4f9f32ee5847a7f31359 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Mon, 4 Apr 2016 18:59:08 +0100 Subject: [PATCH] sprintf --> snprintf to please John. :) --- examples/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/main.c b/examples/main.c index d3e83a3508..ae27534632 100644 --- a/examples/main.c +++ b/examples/main.c @@ -496,7 +496,7 @@ int main(int argc, char *argv[]) { /* Make sure output file is empty, only on one rank. */ char dumpfile[30]; - sprintf(dumpfile, "thread_info_MPI-step%d.dat", j); + snprintf(dumpfile, 30, "thread_info_MPI-step%d.dat", j); FILE *file_thread; if (myrank == 0) { file_thread = fopen(dumpfile, "w"); @@ -543,7 +543,7 @@ int main(int argc, char *argv[]) { #else char dumpfile[30]; - sprintf(dumpfile, "thread_info-step%d.dat", j); + snprintf(dumpfile, 30, "thread_info-step%d.dat", j); FILE *file_thread; file_thread = fopen(dumpfile, "w"); for (int l = 0; l < e.sched.nr_tasks; l++) -- GitLab