From 22a41af141d13f4b29424f9a2215455a7bb88167 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 6 Feb 2011 18:36:21 +0000 Subject: [PATCH] Replace strcpy()+strcat() song and dance by a single sprintf(). [r28331] --- ir/be/bemain.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 1baca253d..1ad8993b3 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -547,9 +547,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name) Get the filename for the profiling data. Beware: '\0' is already included in sizeof(suffix) */ - memset(prof_filename, 0, sizeof(prof_filename)); - strncpy(prof_filename, cup_name, sizeof(prof_filename) - sizeof(suffix)); - strcat(prof_filename, suffix); + sprintf(prof_filename, "%.*s%s\n", (int)(sizeof(prof_filename) - sizeof(suffix)), cup_name, suffix); /* Next: Either instruments all irgs with profiling code -- 2.20.1