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: https://origsvn.digium.com/svn/asterisk/trunk@26451 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2006-05-10 13:22:15 +00:00
parent 8e897e1a53
commit 04ecb29d03
63 changed files with 283 additions and 523 deletions

13
app.c
View File

@@ -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);