aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-01-03 17:47:26 +0100
committerBjörn-Egil Dahlberg <[email protected]>2012-01-03 17:47:26 +0100
commitbbb168d051ba1da4a6012fe59d1e034b11486f5f (patch)
treee69d22e2df5031b74b56b1ff5a191cb66d7fce16
parentce9cab49a50e83ed902c659c699bd96d24f164f4 (diff)
downloadotp-bbb168d051ba1da4a6012fe59d1e034b11486f5f.tar.gz
otp-bbb168d051ba1da4a6012fe59d1e034b11486f5f.tar.bz2
otp-bbb168d051ba1da4a6012fe59d1e034b11486f5f.zip
tools: Use literal formatting in erl_memory.c
* Removes -Wformat-security problems
-rw-r--r--lib/tools/c_src/erl_memory.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c
index 872d55e789..5239176d03 100644
--- a/lib/tools/c_src/erl_memory.c
+++ b/lib/tools/c_src/erl_memory.c
@@ -1224,7 +1224,7 @@ print_main_footer(em_state *state)
switch (state->info.stop_reason) {
case EMTP_STOP:
- p += sprintf(p, stop_str);
+ p += sprintf(p, "%s", stop_str);
break;
case EMTP_EXIT:
p += sprintf(p, exit_str, state->info.exit_status);
@@ -2339,7 +2339,7 @@ usage(char *sw, char *error)
if (error)
exit(1);
else {
- char *help_str =
+ fprintf(filep,
"\n"
" [] - switch is allowed any number of times\n"
" {} - switch is allowed at most one time\n"
@@ -2370,8 +2370,7 @@ usage(char *sw, char *error)
" " SW_CHAR "o - display operation count values\n"
" " SW_CHAR "p <P> - set listen port to <P>\n"
" " SW_CHAR "t - display info about total values\n"
- " " SW_CHAR "v - verbose output\n";
- fprintf(filep, help_str);
+ " " SW_CHAR "v - verbose output\n");
exit(0);
}