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 /channels/chan_iax2.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 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 1df3cf3e8..9ec5045b5 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -788,7 +788,7 @@ static void iax_error_output(const char *data) ast_log(LOG_WARNING, "%s", data); } -static void jb_error_output(const char *fmt, ...) +static void __attribute__((format (printf, 1, 2))) jb_error_output(const char *fmt, ...) { va_list args; char buf[1024]; @@ -797,10 +797,10 @@ static void jb_error_output(const char *fmt, ...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - ast_log(LOG_ERROR, buf); + ast_log(LOG_ERROR, "%s", buf); } -static void jb_warning_output(const char *fmt, ...) +static void __attribute__((format (printf, 1, 2))) jb_warning_output(const char *fmt, ...) { va_list args; char buf[1024]; @@ -809,10 +809,10 @@ static void jb_warning_output(const char *fmt, ...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - ast_log(LOG_WARNING, buf); + ast_log(LOG_WARNING, "%s", buf); } -static void jb_debug_output(const char *fmt, ...) +static void __attribute__((format (printf, 1, 2))) jb_debug_output(const char *fmt, ...) { va_list args; char buf[1024]; @@ -821,7 +821,7 @@ static void jb_debug_output(const char *fmt, ...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - ast_verbose(buf); + ast_verbose("%s", buf); } /*! @@ -5173,11 +5173,12 @@ static int ast_cli_netstats(struct mansession *s, int fd, int limit_fmt) { int x; int numchans = 0; +#define ACN_FORMAT1 "%-25.25s %4d %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d\n" +#define ACN_FORMAT2 "%s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n" for (x=0;x<IAX_MAX_CALLS;x++) { ast_mutex_lock(&iaxsl[x]); if (iaxs[x]) { int localjitter, localdelay, locallost, locallosspct, localdropped, localooo; - char *fmt; jb_info jbinfo; if(ast_test_flag(iaxs[x], IAX_USEJITTERBUF)) { @@ -5196,13 +5197,9 @@ static int ast_cli_netstats(struct mansession *s, int fd, int limit_fmt) localdropped = 0; localooo = -1; } - if (limit_fmt) - fmt = "%-25.25s %4d %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d\n"; - else - fmt = "%s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n"; if (s) - astman_append(s, fmt, + astman_append(s, limit_fmt ? ACN_FORMAT1 : ACN_FORMAT2, iaxs[x]->owner ? iaxs[x]->owner->name : "(None)", iaxs[x]->pingtime, localjitter, @@ -5220,7 +5217,7 @@ static int ast_cli_netstats(struct mansession *s, int fd, int limit_fmt) iaxs[x]->remote_rr.ooo, iaxs[x]->remote_rr.packets/1000); else - ast_cli(fd, fmt, + ast_cli(fd, limit_fmt ? ACN_FORMAT1 : ACN_FORMAT2, iaxs[x]->owner ? iaxs[x]->owner->name : "(None)", iaxs[x]->pingtime, localjitter, |