diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-01-21 08:13:12 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-01-21 08:13:12 +0000 |
commit | 7ad681adc8d5e616165b4d3e6750f2995e782d57 (patch) | |
tree | 368912509e968ce6178e8e9586490a3e9edbac0e /apps/app_realtime.c | |
parent | 847260bb77455e6da12b3847c524741cc1458ce1 (diff) |
remove lots of useless checks of the result of ast_strdupa
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_realtime.c')
-rw-r--r-- | apps/app_realtime.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/apps/app_realtime.c b/apps/app_realtime.c index 9e83d2638..a88620ea6 100644 --- a/apps/app_realtime.c +++ b/apps/app_realtime.c @@ -148,20 +148,19 @@ static int realtime_update_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); - if ((family = ast_strdupa(data))) { - if ((colmatch = strchr(family,'|'))) { - crop_data(colmatch); - if ((value = strchr(colmatch,'|'))) { - crop_data(value); - if ((newcol = strchr(value,'|'))) { - crop_data(newcol); - if ((newval = strchr(newcol,'|'))) - crop_data(newval); - } + family = ast_strdupa(data); + if ((colmatch = strchr(family,'|'))) { + crop_data(colmatch); + if ((value = strchr(colmatch,'|'))) { + crop_data(value); + if ((newcol = strchr(value,'|'))) { + crop_data(newcol); + if ((newval = strchr(newcol,'|'))) + crop_data(newval); } } } - if (! (family && value && colmatch && newcol && newval) ) { + if (!newval) { ast_log(LOG_ERROR,"Invalid input: usage %s\n",UUSAGE); res = -1; } else { @@ -193,17 +192,16 @@ static int realtime_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); - if ((family = ast_strdupa(data))) { - if ((colmatch = strchr(family,'|'))) { - crop_data(colmatch); - if ((value = strchr(colmatch,'|'))) { - crop_data(value); - if ((prefix = strchr(value,'|'))) - crop_data(prefix); - } + family = ast_strdupa(data); + if ((colmatch = strchr(family,'|'))) { + crop_data(colmatch); + if ((value = strchr(colmatch,'|'))) { + crop_data(value); + if ((prefix = strchr(value,'|'))) + crop_data(prefix); } } - if (! (family && value && colmatch) ) { + if (!value) { ast_log(LOG_ERROR,"Invalid input: usage %s\n",USAGE); res = -1; } else { |