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_voicemail.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_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 2a4f496b7..d0b8cc3ba 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -645,7 +645,6 @@ static char *pagerbody = NULL; static char *pagersubject = NULL; static char fromstring[100]; static char pagerfromstring[100]; -static char emailtitle[100]; static char charset[32] = "ISO-8859-1"; static unsigned char adsifdn[4] = "\x00\x00\x00\x0F"; @@ -2021,9 +2020,6 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in ast_channel_free(ast); } else ast_log(LOG_WARNING, "Cannot allocate the channel for variables substitution\n"); - } else if (!ast_strlen_zero(emailtitle)) { - fprintf(p, emailtitle, msgnum + 1, mailbox) ; - fprintf(p, ENDL) ; } else if (ast_test_flag((&globalflags), VM_PBXSKIP)) fprintf(p, "Subject: New message %d in mailbox %s" ENDL, msgnum + 1, mailbox); else @@ -7784,7 +7780,7 @@ static char *complete_voicemail_show_users(const char *line, const char *word, i static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { struct ast_vm_user *vmu; - char *output_format = "%-10s %-5s %-25s %-10s %6s\n"; +#define HVSU_OUTPUT_FORMAT "%-10s %-5s %-25s %-10s %6s\n" const char *context = NULL; int users_counter = 0; @@ -7822,7 +7818,7 @@ static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struc return CLI_FAILURE; } if (a->argc == 3) - ast_cli(a->fd, output_format, "Context", "Mbox", "User", "Zone", "NewMsg"); + ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg"); else { int count = 0; AST_LIST_TRAVERSE(&users, vmu, list) { @@ -7830,7 +7826,7 @@ static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struc count++; } if (count) { - ast_cli(a->fd, output_format, "Context", "Mbox", "User", "Zone", "NewMsg"); + ast_cli(a->fd, HVSU_OUTPUT_FORMAT, "Context", "Mbox", "User", "Zone", "NewMsg"); } else { ast_cli(a->fd, "No such voicemail context \"%s\"\n", context); AST_LIST_UNLOCK(&users); @@ -7845,7 +7841,7 @@ static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struc snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context); inboxcount(tmp, &newmsgs, &oldmsgs); snprintf(count, sizeof(count), "%d", newmsgs); - ast_cli(a->fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count); + ast_cli(a->fd, HVSU_OUTPUT_FORMAT, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count); users_counter++; } } @@ -7858,7 +7854,7 @@ static char *handle_voicemail_show_users(struct ast_cli_entry *e, int cmd, struc static char *handle_voicemail_show_zones(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { struct vm_zone *zone; - char *output_format = "%-15s %-20s %-45s\n"; +#define HVSZ_OUTPUT_FORMAT "%-15s %-20s %-45s\n" char *res = CLI_SUCCESS; switch (cmd) { @@ -7877,9 +7873,9 @@ static char *handle_voicemail_show_zones(struct ast_cli_entry *e, int cmd, struc AST_LIST_LOCK(&zones); if (!AST_LIST_EMPTY(&zones)) { - ast_cli(a->fd, output_format, "Zone", "Timezone", "Message Format"); + ast_cli(a->fd, HVSZ_OUTPUT_FORMAT, "Zone", "Timezone", "Message Format"); AST_LIST_TRAVERSE(&zones, zone, list) { - ast_cli(a->fd, output_format, zone->name, zone->timezone, zone->msg_format); + ast_cli(a->fd, HVSZ_OUTPUT_FORMAT, zone->name, zone->timezone, zone->msg_format); } } else { ast_cli(a->fd, "There are no voicemail zones currently defined\n"); @@ -8706,7 +8702,6 @@ static int load_config(int reload) } memset(fromstring, 0, sizeof(fromstring)); memset(pagerfromstring, 0, sizeof(pagerfromstring)); - memset(emailtitle, 0, sizeof(emailtitle)); strcpy(charset, "ISO-8859-1"); if (emailbody) { ast_free(emailbody); @@ -8744,13 +8739,10 @@ static int load_config(int reload) memcpy(&adsisec[x], &tmpadsi[x], 1); } } - if ((val = ast_variable_retrieve(cfg, "general", "adsiver"))) + if ((val = ast_variable_retrieve(cfg, "general", "adsiver"))) { if (atoi(val)) { adsiver = atoi(val); } - if ((val = ast_variable_retrieve(cfg, "general", "emailtitle"))) { - ast_log(LOG_NOTICE, "Keyword 'emailtitle' is DEPRECATED, please use 'emailsubject' instead.\n"); - ast_copy_string(emailtitle, val, sizeof(emailtitle)); } if ((val = ast_variable_retrieve(cfg, "general", "emailsubject"))) emailsubject = ast_strdup(val); |