I found this sillyness when I did my ast_module_user conversion. Return immediately if no data was passed to the Verbose application.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Joshua Colp 18 years ago
parent b8cd949cce
commit 0dc98ebdf2

@ -54,39 +54,39 @@ static char *log_descrip =
static int verbose_exec(struct ast_channel *chan, void *data) static int verbose_exec(struct ast_channel *chan, void *data)
{ {
char *vtext; char *vtext, *tmp;
int vsize; int vsize;
if (data) { if (ast_strlen_zero(data))
char *tmp; return 0;
vtext = ast_strdupa(data);
tmp = strsep(&vtext, "|"); vtext = ast_strdupa(data);
if (vtext) { tmp = strsep(&vtext, "|");
if (sscanf(tmp, "%d", &vsize) != 1) { if (vtext) {
vsize = 0; if (sscanf(tmp, "%d", &vsize) != 1) {
ast_log(LOG_WARNING, "'%s' is not a verboser number\n", vtext);
}
} else {
vtext = tmp;
vsize = 0; vsize = 0;
ast_log(LOG_WARNING, "'%s' is not a verboser number\n", vtext);
} }
if (option_verbose >= vsize) { } else {
switch (vsize) { vtext = tmp;
case 0: vsize = 0;
ast_verbose("%s\n", vtext); }
break; if (option_verbose >= vsize) {
case 1: switch (vsize) {
ast_verbose(VERBOSE_PREFIX_1 "%s\n", vtext); case 0:
break; ast_verbose("%s\n", vtext);
case 2: break;
ast_verbose(VERBOSE_PREFIX_2 "%s\n", vtext); case 1:
break; ast_verbose(VERBOSE_PREFIX_1 "%s\n", vtext);
case 3: break;
ast_verbose(VERBOSE_PREFIX_3 "%s\n", vtext); case 2:
break; ast_verbose(VERBOSE_PREFIX_2 "%s\n", vtext);
default: break;
ast_verbose(VERBOSE_PREFIX_4 "%s\n", vtext); case 3:
} ast_verbose(VERBOSE_PREFIX_3 "%s\n", vtext);
break;
default:
ast_verbose(VERBOSE_PREFIX_4 "%s\n", vtext);
} }
} }

Loading…
Cancel
Save