diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-18 15:58:50 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-18 15:58:50 +0000 |
commit | 48d2267d2d05bf4acaa2ae4e00e3d9b600cce235 (patch) | |
tree | b91e3d85242f15336883bd197abbe86cd66fdfc8 /apps/app_minivm.c | |
parent | 99e420ecd8ad845f253266482101298583994c00 (diff) |
Merged revisions 109447 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r109447 | twilson | 2008-03-18 10:43:34 -0500 (Tue, 18 Mar 2008) | 3 lines
Go through and fix a bunch of places where character strings were being interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not
actual problems, per se. I also added format attributes to any printf wrapper functions I found that didn't have them. -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@109459 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_minivm.c')
-rw-r--r-- | apps/app_minivm.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/app_minivm.c b/apps/app_minivm.c index ae76f9e89..2b70d87e4 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -1560,10 +1560,10 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav duration < global_vmminmessage ? "IGNORED" : "OK", vmu->accountcode ); - fprintf(txt, logbuf); + fprintf(txt, "%s", logbuf); if (minivmlogfile) { ast_mutex_lock(&minivmloglock); - fprintf(minivmlogfile, logbuf); + fprintf(minivmlogfile, "%s", logbuf); ast_mutex_unlock(&minivmloglock); } @@ -2474,7 +2474,7 @@ static int load_config(int reload) static char *handle_minivm_list_templates(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { struct minivm_template *this; - char *output_format = "%-15s %-10s %-10s %-15.15s %-50s\n"; +#define HVLT_OUTPUT_FORMAT "%-15s %-10s %-10s %-15.15s %-50s\n" int count = 0; switch (cmd) { @@ -2497,10 +2497,10 @@ static char *handle_minivm_list_templates(struct ast_cli_entry *e, int cmd, stru AST_LIST_UNLOCK(&message_templates); return CLI_FAILURE; } - ast_cli(a->fd, output_format, "Template name", "Charset", "Locale", "Attach media", "Subject"); - ast_cli(a->fd, output_format, "-------------", "-------", "------", "------------", "-------"); + ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "Template name", "Charset", "Locale", "Attach media", "Subject"); + ast_cli(a->fd, HVLT_OUTPUT_FORMAT, "-------------", "-------", "------", "------------", "-------"); AST_LIST_TRAVERSE(&message_templates, this, list) { - ast_cli(a->fd, output_format, this->name, + ast_cli(a->fd, HVLT_OUTPUT_FORMAT, this->name, this->charset ? this->charset : "-", this->locale ? this->locale : "-", this->attachment ? "Yes" : "No", @@ -2540,7 +2540,7 @@ static char *complete_minivm_show_users(const char *line, const char *word, int static char *handle_minivm_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { struct minivm_account *vmu; - char *output_format = "%-23s %-15s %-15s %-10s %-10s %-50s\n"; +#define HMSU_OUTPUT_FORMAT "%-23s %-15s %-15s %-10s %-10s %-50s\n" int count = 0; switch (cmd) { @@ -2565,14 +2565,14 @@ static char *handle_minivm_show_users(struct ast_cli_entry *e, int cmd, struct a AST_LIST_UNLOCK(&minivm_accounts); return CLI_FAILURE; } - ast_cli(a->fd, output_format, "User", "E-Template", "P-template", "Zone", "Format", "Full name"); - ast_cli(a->fd, output_format, "----", "----------", "----------", "----", "------", "---------"); + ast_cli(a->fd, HMSU_OUTPUT_FORMAT, "User", "E-Template", "P-template", "Zone", "Format", "Full name"); + ast_cli(a->fd, HMSU_OUTPUT_FORMAT, "----", "----------", "----------", "----", "------", "---------"); AST_LIST_TRAVERSE(&minivm_accounts, vmu, list) { char tmp[256] = ""; if ((a->argc == 3) || ((a->argc == 5) && !strcmp(a->argv[4], vmu->domain))) { count++; snprintf(tmp, sizeof(tmp), "%s@%s", vmu->username, vmu->domain); - ast_cli(a->fd, output_format, tmp, vmu->etemplate ? vmu->etemplate : "-", + ast_cli(a->fd, HMSU_OUTPUT_FORMAT, tmp, vmu->etemplate ? vmu->etemplate : "-", vmu->ptemplate ? vmu->ptemplate : "-", vmu->zonetag ? vmu->zonetag : "-", vmu->attachfmt ? vmu->attachfmt : "-", @@ -2588,7 +2588,7 @@ static char *handle_minivm_show_users(struct ast_cli_entry *e, int cmd, struct a static char *handle_minivm_show_zones(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { struct minivm_zone *zone; - char *output_format = "%-15s %-20s %-45s\n"; +#define HMSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n" char *res = CLI_SUCCESS; switch (cmd) { @@ -2607,10 +2607,10 @@ static char *handle_minivm_show_zones(struct ast_cli_entry *e, int cmd, struct a AST_LIST_LOCK(&minivm_zones); if (!AST_LIST_EMPTY(&minivm_zones)) { - ast_cli(a->fd, output_format, "Zone", "Timezone", "Message Format"); - ast_cli(a->fd, output_format, "----", "--------", "--------------"); + ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, "Zone", "Timezone", "Message Format"); + ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, "----", "--------", "--------------"); AST_LIST_TRAVERSE(&minivm_zones, zone, list) { - ast_cli(a->fd, output_format, zone->name, zone->timezone, zone->msg_format); + ast_cli(a->fd, HMSZ_OUTPUT_FORMAT, zone->name, zone->timezone, zone->msg_format); } } else { ast_cli(a->fd, "There are no voicemail zones currently defined\n"); |