diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-03 17:44:30 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-03 17:44:30 +0000 |
commit | 72f63742228f8fabd6ba36a478c3606d3ab974f2 (patch) | |
tree | fc0bbad7bee40243d11dcfc72cd10f06a0e66061 /channel.c | |
parent | 17eefffe91486990926654c3c62442e8c3b20b6d (diff) |
remove useless variables, and argument checks for functions
that can safely handle a NULL argument.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@24464 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r-- | channel.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -1008,9 +1008,7 @@ struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_inf datastore->info = info; - if (uid != NULL) { - datastore->uid = ast_strdup(uid); - } + datastore->uid = ast_strdup(uid); return datastore; } @@ -1483,12 +1481,10 @@ int ast_answer(struct ast_channel *chan) if (chan->tech->answer) res = chan->tech->answer(chan); ast_setstate(chan, AST_STATE_UP); - if (chan->cdr) - ast_cdr_answer(chan->cdr); + ast_cdr_answer(chan->cdr); break; case AST_STATE_UP: - if (chan->cdr) - ast_cdr_answer(chan->cdr); + ast_cdr_answer(chan->cdr); break; } ast_channel_unlock(chan); @@ -3736,14 +3732,13 @@ int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, i ast_group_t ast_get_group(char *s) { - char *copy; char *piece; - char *c=NULL; + char *c; int start=0, finish=0, x; ast_group_t group = 0; - c = copy = ast_strdupa(s); - if (!copy) + c = ast_strdupa(s); + if (!c) return 0; while ((piece = strsep(&c, ","))) { |