aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_realtime.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-21 08:13:12 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-21 08:13:12 +0000
commit3f2c7248c603bebb962be9879a320eca1f147a53 (patch)
tree368912509e968ce6178e8e9586490a3e9edbac0e /apps/app_realtime.c
parent7d766728281dd1b6eb53a4ec8d0e8e5d6312835c (diff)
remove lots of useless checks of the result of ast_strdupa
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8379 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_realtime.c')
-rw-r--r--apps/app_realtime.c38
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 {