aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_minivm.c
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-18 15:43:34 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-18 15:43:34 +0000
commit9e8ebe6a94eb44796b296dfc214622ac583d4630 (patch)
treea07721daf3a91733bc3e073bab0697333d426e21 /apps/app_minivm.c
parent421d5fe68591bbafcf04602c3bba927cac40a2a9 (diff)
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/trunk@109447 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_minivm.c')
-rw-r--r--apps/app_minivm.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/app_minivm.c b/apps/app_minivm.c
index f11537ed0..1ac2576fe 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);
}
@@ -2475,7 +2475,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) {
@@ -2498,10 +2498,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",
@@ -2541,7 +2541,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) {
@@ -2566,14 +2566,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 : "-",
@@ -2589,7 +2589,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) {
@@ -2608,10 +2608,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");