aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 13:22:15 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 13:22:15 +0000
commitd99b677f3501944b7aaf82375ef62a88e5fa3933 (patch)
tree167bf7a9b6b330883dc9bf865672132658710ffd /app.c
parenta6b2177d50659d049694ca79f6cbe00f54dd0a93 (diff)
remove almost all of the checks of the result from ast_strdupa() or alloca().
As it turns out, all of these checks were useless, because alloca will never return NULL. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26451 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rw-r--r--app.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/app.c b/app.c
index afc621390..dcd4d6dc7 100644
--- a/app.c
+++ b/app.c
@@ -523,7 +523,7 @@ static int __ast_play_and_record(struct ast_channel *chan, const char *playfile,
ast_log(LOG_DEBUG,"Recording Formats: sfmts=%s\n", fmts);
sfmt[0] = ast_strdupa(fmts);
- while((fmt = strsep(&stringp, "|"))) {
+ while ((fmt = strsep(&stringp, "|"))) {
if (fmtcnt > MAX_OTHER_FORMATS - 1) {
ast_log(LOG_WARNING, "Please increase MAX_OTHER_FORMATS in app.c\n");
break;
@@ -1092,13 +1092,12 @@ static int ivr_dispatch(struct ast_channel *chan, struct ast_ivr_option *option,
case AST_ACTION_BACKLIST:
res = 0;
c = ast_strdupa(option->adata);
- if (c) {
- while((n = strsep(&c, ";")))
- if ((res = ast_stream_and_wait(chan, n, chan->language,
- (option->action == AST_ACTION_BACKLIST) ? AST_DIGIT_ANY : "")))
- break;
- ast_stopstream(chan);
+ while ((n = strsep(&c, ";"))) {
+ if ((res = ast_stream_and_wait(chan, n, chan->language,
+ (option->action == AST_ACTION_BACKLIST) ? AST_DIGIT_ANY : "")))
+ break;
}
+ ast_stopstream(chan);
return res;
default:
ast_log(LOG_NOTICE, "Unknown dispatch function %d, ignoring!\n", option->action);