mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
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:
13
app.c
13
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);
|
||||
|
||||
Reference in New Issue
Block a user