projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
16fc4cd
)
Replace strcpy()+strcat() song and dance by a single sprintf().
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 6 Feb 2011 18:36:21 +0000
(18:36 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 6 Feb 2011 18:36:21 +0000
(18:36 +0000)
[r28331]
ir/be/bemain.c
patch
|
blob
|
history
diff --git
a/ir/be/bemain.c
b/ir/be/bemain.c
index
1baca25
..
1ad8993
100644
(file)
--- 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