diff options
59 files changed, 108 insertions, 109 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c index d7d7c364d..d3e525460 100755 --- a/apps/app_adsiprog.c +++ b/apps/app_adsiprog.c @@ -1555,7 +1555,7 @@ static int adsi_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); - if (!data || ast_strlen_zero(data)) + if (ast_strlen_zero(data)) data = "asterisk.adsi"; if (!adsi_available(chan)) { diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c index 3e8fe4cce..0d00d1d34 100755 --- a/apps/app_alarmreceiver.c +++ b/apps/app_alarmreceiver.c @@ -117,7 +117,7 @@ static void database_increment( char *key ) char value[16]; - if(!strlen(db_family)) + if (ast_strlen_zero(db_family)) return; /* If not defined, don't do anything */ res = ast_db_get(db_family, key, value, sizeof(value) - 1); @@ -392,7 +392,7 @@ static int log_events(struct ast_channel *chan, char *signalling_type, event_no FILE *logfile; event_node_t *elp = event; - if(strlen(event_spool_dir)){ + if (!ast_strlen_zero(event_spool_dir)) { /* Make a template */ @@ -516,7 +516,7 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int ast_verbose(VERBOSE_PREFIX_2 "AlarmReceiver: Incomplete string: %s, trying again...\n", event); if(!got_some_digits){ - got_some_digits = (strlen(event)) ? 1 : 0; + got_some_digits = (!ast_strlen_zero(event)) ? 1 : 0; ack_retries++; } continue; @@ -715,7 +715,7 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data) * Do we exec a command line at the end? */ - if((!res) && (strlen(event_app)) && (event_head)){ + if((!res) && (!ast_strlen_zero(event_app)) && (event_head)){ ast_log(LOG_DEBUG,"Alarmreceiver: executing: %s\n", event_app); ast_safe_system(event_app); } diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c index 593ced433..350fdc51c 100755 --- a/apps/app_authenticate.c +++ b/apps/app_authenticate.c @@ -85,7 +85,7 @@ static int auth_exec(struct ast_channel *chan, void *data) char *opts; char *prompt; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Authenticate requires an argument(password)\n"); return -1; } diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index 9975eebb4..0f51481a9 100755 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -74,7 +74,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data) char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur, *options, *stringp; struct ast_channel *tempchan; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "ChanIsAvail requires an argument (Zap/1&Zap/2)\n"); return -1; } diff --git a/apps/app_controlplayback.c b/apps/app_controlplayback.c index b8e68a3dc..21320ac9d 100755 --- a/apps/app_controlplayback.c +++ b/apps/app_controlplayback.c @@ -81,7 +81,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) arg_restart = 6, }; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n"); return -1; } diff --git a/apps/app_curl.c b/apps/app_curl.c index 596b908b6..aa7f73731 100755 --- a/apps/app_curl.c +++ b/apps/app_curl.c @@ -123,14 +123,14 @@ static int curl_exec(struct ast_channel *chan, void *data) dep_warning = 1; } - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Curl requires an argument (URL)\n"); return -1; } LOCAL_USER_ADD(u); - if ((info = ast_strdupa((char *)data))) { + if ((info = ast_strdupa(data))) { url = strsep(&info, "|"); post_data = info; } else { @@ -166,7 +166,7 @@ static char *acf_curl_exec(struct ast_channel *chan, char *cmd, char *data, char *buf = '\0'; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "CURL requires an argument (URL)\n"); return buf; } diff --git a/apps/app_db.c b/apps/app_db.c index e808c8ef6..0cc0344d5 100755 --- a/apps/app_db.c +++ b/apps/app_db.c @@ -97,7 +97,7 @@ static int deltree_exec(struct ast_channel *chan, void *data) LOCAL_USER_REMOVE(u); return 0; } - if (!strlen(keytree)) + if (ast_strlen_zero(keytree)) keytree = 0; } else { family = argv; diff --git a/apps/app_dial.c b/apps/app_dial.c index 5792e34a2..36e5030d0 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -399,7 +399,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu if (ast_test_flag(o, DIAL_FORCECALLERID)) { char *newcid = NULL; - if (strlen(in->macroexten)) + if (!ast_strlen_zero(in->macroexten)) newcid = in->macroexten; else newcid = in->exten; @@ -691,7 +691,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags char *dblgoto = NULL; int priority_jump = 0; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n"); return -1; } @@ -731,7 +731,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags } } else timeout = NULL; - if (!peers || ast_strlen_zero(peers)) { + if (ast_strlen_zero(peers)) { ast_log(LOG_WARNING, "Dial argument takes format (technology1/number1&technology2/number2...|optional timeout)\n"); goto out; } @@ -965,7 +965,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags char callerid[60]; l = chan->cid.cid_num; - if (l && !ast_strlen_zero(l)) { + if (!ast_strlen_zero(l)) { ast_shrink_phone_number(l); if( privacy ) { if (option_verbose > 2) @@ -1235,7 +1235,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags cur = rest; } while (cur); - if (timeout && !ast_strlen_zero(timeout)) { + if (!ast_strlen_zero(timeout)) { to = atoi(timeout); if (to > 0) to *= 1000; @@ -1294,12 +1294,11 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags if (!number) number = numsubst; pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number); - /* JDG: sendurl */ - if ( url && !ast_strlen_zero(url) && ast_channel_supports_html(peer) ) { + if (!ast_strlen_zero(url) && ast_channel_supports_html(peer) ) { ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", url); ast_channel_sendurl( peer, url ); - } /* /JDG */ - if( privacy || screen ) { + } + if (privacy || screen) { int res2; int loopcount = 0; if( privdb_val == AST_PRIVACY_UNKNOWN ) { @@ -1594,12 +1593,12 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags time(&now); chan->whentohangup = now + calldurationlimit; } - if (dtmfcalled && !ast_strlen_zero(dtmfcalled)) { + if (!ast_strlen_zero(dtmfcalled)) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the called party.\n",dtmfcalled); res = ast_dtmf_stream(peer,chan,dtmfcalled,250); } - if (dtmfcalling && !ast_strlen_zero(dtmfcalling)) { + if (!ast_strlen_zero(dtmfcalling)) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the calling party.\n",dtmfcalling); res = ast_dtmf_stream(chan,peer,dtmfcalling,250); @@ -1698,7 +1697,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data) struct localuser *u; struct ast_flags peerflags; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "RetryDial requires an argument!\n"); return -1; } diff --git a/apps/app_dictate.c b/apps/app_dictate.c index bf17432d2..0df5a5604 100755 --- a/apps/app_dictate.c +++ b/apps/app_dictate.c @@ -101,7 +101,7 @@ static int dictate_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR); - if (data && !ast_strlen_zero(data) && (mydata = ast_strdupa(data))) { + if (!ast_strlen_zero(data) && (mydata = ast_strdupa(data))) { argc = ast_separate_app_args(mydata, '|', argv, sizeof(argv) / sizeof(argv[0])); } diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c index 7be20881f..84f350746 100755 --- a/apps/app_directed_pickup.c +++ b/apps/app_directed_pickup.c @@ -57,7 +57,7 @@ static int pickup_exec(struct ast_channel *chan, void *data) char *tmp = NULL, *exten = NULL, *context = NULL; char workspace[256] = ""; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Pickup requires an argument (extension) !\n"); return -1; } diff --git a/apps/app_directory.c b/apps/app_directory.c index fd31be965..8c54d74cc 100755 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -293,7 +293,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * int lastuserchoice = 0; char *start, *pos, *conv,*stringp=NULL; - if (!context || ast_strlen_zero(context)) { + if (ast_strlen_zero(context)) { ast_log(LOG_WARNING, "Directory must be called with an argument " "(context in which to interpret extensions)\n"); @@ -410,7 +410,7 @@ static int directory_exec(struct ast_channel *chan, void *data) int last = 1; char *context, *dialcontext, *dirintro, *options; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Directory requires an argument (context[,dialcontext])\n"); return -1; } @@ -439,9 +439,9 @@ static int directory_exec(struct ast_channel *chan, void *data) } dirintro = ast_variable_retrieve(cfg, context, "directoryintro"); - if (!dirintro || ast_strlen_zero(dirintro)) + if (ast_strlen_zero(dirintro)) dirintro = ast_variable_retrieve(cfg, "general", "directoryintro"); - if (!dirintro || ast_strlen_zero(dirintro)) { + if (ast_strlen_zero(dirintro)) { if (last) dirintro = "dir-intro"; else diff --git a/apps/app_disa.c b/apps/app_disa.c index 8075911f8..6e52b0dde 100755 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -126,7 +126,7 @@ static int disa_exec(struct ast_channel *chan, void *data) FILE *fp; char *stringp=NULL; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "disa requires an argument (passcode/passcode file)\n"); return -1; } diff --git a/apps/app_dumpchan.c b/apps/app_dumpchan.c index 65e8f1d20..2375f2261 100755 --- a/apps/app_dumpchan.c +++ b/apps/app_dumpchan.c @@ -141,7 +141,7 @@ static int dumpchan_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); - if (data && !ast_strlen_zero(data)) { + if (!ast_strlen_zero(data)) { level = atoi(data); } diff --git a/apps/app_enumlookup.c b/apps/app_enumlookup.c index c87d7a1fc..0c3fca6de 100755 --- a/apps/app_enumlookup.c +++ b/apps/app_enumlookup.c @@ -85,7 +85,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data) static int dep_warning=0; struct localuser *u; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "EnumLookup requires an argument (extension)\n"); return -1; } diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 6630662b5..f6dbc9c9f 100755 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -262,7 +262,7 @@ static int app_exec(struct ast_channel *chan, void *data) AST_LIST_HEAD_INIT(&u->finishlist); u->abort_current_sound = 0; - if (!args || ast_strlen_zero(args)) { + if (ast_strlen_zero(args)) { ast_log(LOG_WARNING, "ExternalIVR requires a command to execute\n"); goto exit; } diff --git a/apps/app_festival.c b/apps/app_festival.c index d644a8772..539d245bb 100755 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -296,7 +296,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata) char *intstr; struct ast_config *cfg; - if (!vdata || ast_strlen_zero(vdata)) { + if (ast_strlen_zero(vdata)) { ast_log(LOG_WARNING, "festival requires an argument (text)\n"); return -1; } diff --git a/apps/app_forkcdr.c b/apps/app_forkcdr.c index 9ff84b257..6ccaab415 100755 --- a/apps/app_forkcdr.c +++ b/apps/app_forkcdr.c @@ -74,7 +74,7 @@ static int forkcdr_exec(struct ast_channel *chan, void *data) int res=0; struct localuser *u; LOCAL_USER_ADD(u); - if (data && !ast_strlen_zero(data)) + if (!ast_strlen_zero(data)) ast_set2_flag(chan->cdr, strchr((char *)data, 'v'), AST_CDR_FLAG_KEEP_VARS); ast_cdr_fork(chan); diff --git a/apps/app_groupcount.c b/apps/app_groupcount.c index 6ddb20f65..8d7479c15 100755 --- a/apps/app_groupcount.c +++ b/apps/app_groupcount.c @@ -145,7 +145,7 @@ static int group_check_exec(struct ast_channel *chan, void *data) deprecation_warning = 1; } - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "CheckGroup requires an argument(max[@category])\n"); return res; } diff --git a/apps/app_hasnewvoicemail.c b/apps/app_hasnewvoicemail.c index 47f9a4256..bdf3014cb 100755 --- a/apps/app_hasnewvoicemail.c +++ b/apps/app_hasnewvoicemail.c @@ -115,13 +115,13 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data) temps = input; if ((temps = strsep(&input, "|"))) { - if (input && !ast_strlen_zero(input)) + if (!ast_strlen_zero(input)) varname = input; input = temps; } if ((vmbox = strsep(&input, "@"))) - if (input && !ast_strlen_zero(input)) + if (!ast_strlen_zero(input)) context = input; if (!vmbox) vmbox = input; diff --git a/apps/app_ices.c b/apps/app_ices.c index f7a2b014c..1bc4b8ced 100755 --- a/apps/app_ices.c +++ b/apps/app_ices.c @@ -101,7 +101,7 @@ static int ices_exec(struct ast_channel *chan, void *data) char filename[256]=""; char *c; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "ICES requires an argument (configfile.xml)\n"); return -1; } diff --git a/apps/app_image.c b/apps/app_image.c index 21a98d8da..0e43e2a3e 100755 --- a/apps/app_image.c +++ b/apps/app_image.c @@ -61,7 +61,7 @@ static int sendimage_exec(struct ast_channel *chan, void *data) int res = 0; struct localuser *u; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "SendImage requires an argument (filename)\n"); return -1; } diff --git a/apps/app_ivrdemo.c b/apps/app_ivrdemo.c index c91fde4a5..16cf45718 100755 --- a/apps/app_ivrdemo.c +++ b/apps/app_ivrdemo.c @@ -89,7 +89,7 @@ static int skel_exec(struct ast_channel *chan, void *data) int res=0; struct localuser *u; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "skel requires an argument (filename)\n"); return -1; } diff --git a/apps/app_macro.c b/apps/app_macro.c index 2100f03f9..42e0c7801 100755 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -111,7 +111,7 @@ static int macro_exec(struct ast_channel *chan, void *data) char *save_macro_offset; struct localuser *u; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Macro() requires arguments. See \"show application macro\" for help.\n"); return -1; } @@ -137,7 +137,7 @@ static int macro_exec(struct ast_channel *chan, void *data) tmp = ast_strdupa(data); rest = tmp; macro = strsep(&rest, "|"); - if (!macro || ast_strlen_zero(macro)) { + if (ast_strlen_zero(macro)) { ast_log(LOG_WARNING, "Invalid macro name specified\n"); LOCAL_USER_REMOVE(u); return 0; diff --git a/apps/app_math.c b/apps/app_math.c index dd8f3bb86..f74e1efee 100755 --- a/apps/app_math.c +++ b/apps/app_math.c @@ -108,7 +108,7 @@ static int math_exec(struct ast_channel *chan, void *data) deprecation_warning = 1; } - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "No parameters passed. !\n"); return -1; } diff --git a/apps/app_md5.c b/apps/app_md5.c index 648ac1bd3..d30f3c216 100755 --- a/apps/app_md5.c +++ b/apps/app_md5.c @@ -73,7 +73,7 @@ static int md5_exec(struct ast_channel *chan, void *data) dep_warning = 1; } - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Syntax: md5(<varname>=<string>) - missing argument!\n"); return -1; } @@ -110,7 +110,7 @@ static int md5check_exec(struct ast_channel *chan, void *data) dep_warning = 1; } - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Syntax: MD5Check(<md5hash>,<string>) - missing argument!\n"); return -1; } diff --git a/apps/app_meetme.c b/apps/app_meetme.c index e980bbd39..9350566b7 100755 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -1663,7 +1663,7 @@ static int count_exec(struct ast_channel *chan, void *data) char *confnum, *localdata; char val[80] = "0"; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "MeetMeCount requires an argument (conference number)\n"); return -1; } @@ -1684,7 +1684,7 @@ static int count_exec(struct ast_channel *chan, void *data) else count = 0; - if (localdata && !ast_strlen_zero(localdata)){ + if (!ast_strlen_zero(localdata)){ /* have var so load it and exit */ snprintf(val,sizeof(val), "%d",count); pbx_builtin_setvar_helper(chan, localdata,val); @@ -1714,7 +1714,7 @@ static int conf_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { allowretry = 1; notdata = ""; } else { @@ -1972,7 +1972,7 @@ static int admin_exec(struct ast_channel *chan, void *data) { ast_mutex_lock(&conflock); /* The param has the conference number the user and the command to execute */ - if (data && !ast_strlen_zero(data)) { + if (!ast_strlen_zero(data)) { params = ast_strdupa((char *) data); conf = strsep(¶ms, "|"); command = strsep(¶ms, "|"); diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index 419e951fc..ab8045835 100755 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -385,7 +385,7 @@ static int muxmon_exec(struct ast_channel *chan, void *data) *filename = NULL, *post_process = NULL; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "muxmon requires an argument\n"); return -1; } @@ -409,7 +409,7 @@ static int muxmon_exec(struct ast_channel *chan, void *data) } } - if (!filename || ast_strlen_zero(filename)) { + if (ast_strlen_zero(filename)) { ast_log(LOG_WARNING, "Muxmon requires an argument (filename)\n"); LOCAL_USER_REMOVE(u); return -1; diff --git a/apps/app_mp3.c b/apps/app_mp3.c index 2c0334042..51844fa25 100755 --- a/apps/app_mp3.c +++ b/apps/app_mp3.c @@ -128,7 +128,7 @@ static int mp3_exec(struct ast_channel *chan, void *data) short frdata[160]; } myf; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "MP3 Playback requires an argument (filename)\n"); return -1; } diff --git a/apps/app_muxmon.c b/apps/app_muxmon.c index 419e951fc..ab8045835 100755 --- a/apps/app_muxmon.c +++ b/apps/app_muxmon.c @@ -385,7 +385,7 @@ static int muxmon_exec(struct ast_channel *chan, void *data) *filename = NULL, *post_process = NULL; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "muxmon requires an argument\n"); return -1; } @@ -409,7 +409,7 @@ static int muxmon_exec(struct ast_channel *chan, void *data) } } - if (!filename || ast_strlen_zero(filename)) { + if (ast_strlen_zero(filename)) { ast_log(LOG_WARNING, "Muxmon requires an argument (filename)\n"); LOCAL_USER_REMOVE(u); return -1; diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c index 6a0bc6aec..4cb8f2b04 100755 --- a/apps/app_osplookup.c +++ b/apps/app_osplookup.c @@ -110,7 +110,7 @@ static int osplookup_exec(struct ast_channel *chan, void *data) char *provider, *opts=NULL; struct ast_osp_result result; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "OSPLookup requires an argument (extension)\n"); return -1; } @@ -169,7 +169,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data) int cause; struct ast_osp_result result; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "OSPNext should have an argument (cause)\n"); return -1; } @@ -179,7 +179,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data) cause = str2cause((char *)data); temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE"); result.handle = -1; - if (temp && strlen(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) { + if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) { if ((res = ast_osp_next(&result, cause)) > 0) { char tmp[80]; snprintf(tmp, sizeof(tmp), "%d", result.handle); @@ -217,7 +217,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data) time_t start=0, duration=0; struct ast_osp_result result; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "OSPFinish should have an argument (cause)\n"); return -1; } @@ -236,7 +236,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data) cause = str2cause((char *)data); temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE"); result.handle = -1; - if (temp && strlen(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) { + if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) { if (!ast_osp_terminate(result.handle, cause, start, duration)) { pbx_builtin_setvar_helper(chan, "_OSPHANDLE", ""); res = 1; diff --git a/apps/app_page.c b/apps/app_page.c index 8db0356e6..921316d81 100755 --- a/apps/app_page.c +++ b/apps/app_page.c @@ -120,7 +120,7 @@ static int page_exec(struct ast_channel *chan, void *data) char *tmp; int res=0; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "This application requires at least one argument (destination(s) to page)\n"); return -1; } diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c index 109226a34..6c9650fdb 100755 --- a/apps/app_parkandannounce.c +++ b/apps/app_parkandannounce.c @@ -81,7 +81,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) struct localuser *u; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "ParkAndAnnounce requires arguments: (announce:template|timeout|dial|[return_context])\n"); return -1; } diff --git a/apps/app_playback.c b/apps/app_playback.c index 1e858b0a1..5808197c4 100755 --- a/apps/app_playback.c +++ b/apps/app_playback.c @@ -70,7 +70,7 @@ static int playback_exec(struct ast_channel *chan, void *data) char *stringp = NULL; char *front = NULL, *back = NULL; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Playback requires an argument (filename)\n"); return -1; } diff --git a/apps/app_privacy.c b/apps/app_privacy.c index 44de165ce..d0b2e44cd 100755 --- a/apps/app_privacy.c +++ b/apps/app_privacy.c @@ -85,7 +85,7 @@ privacy_exec (struct ast_channel *chan, void *data) struct ast_config *cfg; LOCAL_USER_ADD (u); - if (chan->cid.cid_num && !ast_strlen_zero(chan->cid.cid_num)) { + if (!ast_strlen_zero(chan->cid.cid_num)) { if (option_verbose > 2) ast_verbose (VERBOSE_PREFIX_3 "CallerID Present: Skipping\n"); } else { diff --git a/apps/app_queue.c b/apps/app_queue.c index a98612cc4..daa543235 100755 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2554,7 +2554,7 @@ static int pqm_exec(struct ast_channel *chan, void *data) struct localuser *u; char *queuename, *interface; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "PauseQueueMember requires an argument ([queuename]|interface])\n"); return -1; } @@ -2598,7 +2598,7 @@ static int upqm_exec(struct ast_channel *chan, void *data) struct localuser *u; char *queuename, *interface; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "UnpauseQueueMember requires an argument ([queuename]|interface])\n"); return -1; } @@ -2645,7 +2645,7 @@ static int rqm_exec(struct ast_channel *chan, void *data) char tmpchan[256]=""; char *interface = NULL; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "RemoveQueueMember requires an argument (queuename[|interface])\n"); return -1; } @@ -2709,7 +2709,7 @@ static int aqm_exec(struct ast_channel *chan, void *data) char *penaltys=NULL; int penalty = 0; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "AddQueueMember requires an argument (queuename[|[interface][|penalty]])\n"); return -1; } @@ -2737,14 +2737,14 @@ static int aqm_exec(struct ast_channel *chan, void *data) penaltys++; } } - if (!interface || ast_strlen_zero(interface)) { + if (ast_strlen_zero(interface)) { ast_copy_string(tmpchan, chan->name, sizeof(tmpchan)); interface = strrchr(tmpchan, '-'); if (interface) *interface = '\0'; interface = tmpchan; } - if (penaltys && !ast_strlen_zero(penaltys)) { + if (!ast_strlen_zero(penaltys)) { if ((sscanf(penaltys, "%d", &penalty) != 1) || penalty < 0) { ast_log(LOG_WARNING, "Penalty '%s' is invalid, must be an integer >= 0\n", penaltys); penalty = 0; @@ -2797,7 +2797,7 @@ static int queue_exec(struct ast_channel *chan, void *data) /* Our queue entry */ struct queue_ent qe; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Queue requires an argument: queuename[|options[|URL][|announceoverride][|timeout]]\n"); return -1; } @@ -3035,7 +3035,7 @@ static char *queue_function_qac(struct ast_channel *chan, char *cmd, char *data, ast_copy_string(buf, "0", len); - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "QUEUEAGENTCOUNT requires an argument: queuename\n"); LOCAL_USER_REMOVE(u); return buf; diff --git a/apps/app_random.c b/apps/app_random.c index 5f2c6cd87..08e1d188a 100755 --- a/apps/app_random.c +++ b/apps/app_random.c @@ -63,7 +63,7 @@ static int random_exec(struct ast_channel *chan, void *data) char *prob; int probint; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Random requires an argument ([probability]:[[context|]extension|]priority)\n"); return -1; } diff --git a/apps/app_read.c b/apps/app_read.c index ecf472e59..0c4e2872b 100755 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -89,7 +89,7 @@ static int read_exec(struct ast_channel *chan, void *data) char *argcopy = NULL; char *args[8]; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Read requires an argument (variable)\n"); return -1; } @@ -143,7 +143,7 @@ static int read_exec(struct ast_channel *chan, void *data) to *= 1000; } - if (!(filename) || ast_strlen_zero(filename)) + if (ast_strlen_zero(filename)) filename = NULL; if (maxdigitstr) { maxdigits = atoi(maxdigitstr); @@ -152,7 +152,7 @@ static int read_exec(struct ast_channel *chan, void *data) } else if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %d digits.\n", maxdigits); } - if (!(varname) || ast_strlen_zero(varname)) { + if (ast_strlen_zero(varname)) { ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n"); LOCAL_USER_REMOVE(u); return -1; diff --git a/apps/app_readfile.c b/apps/app_readfile.c index 07d30ed78..4012bc6a2 100755 --- a/apps/app_readfile.c +++ b/apps/app_readfile.c @@ -63,7 +63,7 @@ static int readfile_exec(struct ast_channel *chan, void *data) char *s, *varname=NULL, *file=NULL, *length=NULL, *returnvar=NULL; int len=0; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "ReadFile require an argument!\n"); return -1; } diff --git a/apps/app_realtime.c b/apps/app_realtime.c index ff7396520..b0a810a8a 100755 --- a/apps/app_realtime.c +++ b/apps/app_realtime.c @@ -130,7 +130,7 @@ static int realtime_update_exec(struct ast_channel *chan, void *data) struct localuser *u; int res = 0; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_ERROR,"Invalid input: usage %s\n",UUSAGE); return -1; } @@ -171,7 +171,7 @@ static int realtime_exec(struct ast_channel *chan, void *data) char *family=NULL, *colmatch=NULL, *value=NULL, *prefix=NULL, *vname=NULL; size_t len; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_ERROR,"Invalid input: usage %s\n",USAGE); return -1; } diff --git a/apps/app_record.c b/apps/app_record.c index 90def26f2..38fadf001 100755 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -100,7 +100,7 @@ static int record_exec(struct ast_channel *chan, void *data) int flags; /* The next few lines of code parse out the filename and header from the input string */ - if (!data || ast_strlen_zero(data)) { /* no data implies no filename or anything is present */ + if (ast_strlen_zero(data)) { /* no data implies no filename or anything is present */ ast_log(LOG_WARNING, "Record requires an argument (filename)\n"); return -1; } diff --git a/apps/app_rpt.c b/apps/app_rpt.c index 9f53a3153..377a99578 100755 --- a/apps/app_rpt.c +++ b/apps/app_rpt.c @@ -5839,7 +5839,7 @@ static int rpt_exec(struct ast_channel *chan, void *data) ZT_PARAMS par; int ms,elap; - if (!data || ast_strlen_zero((char *)data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Rpt requires an argument (system node)\n"); return -1; } diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c index 4625e3b44..f9493f716 100755 --- a/apps/app_senddtmf.c +++ b/apps/app_senddtmf.c @@ -62,7 +62,7 @@ static int senddtmf_exec(struct ast_channel *chan, void *data) char *digits = NULL, *to = NULL; int timeout = 250; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "SendDTMF requires an argument (digits or *#aAbBcCdD)\n"); return 0; } diff --git a/apps/app_sendtext.c b/apps/app_sendtext.c index 917b8d71d..7bdf1d265 100755 --- a/apps/app_sendtext.c +++ b/apps/app_sendtext.c @@ -71,7 +71,7 @@ static int sendtext_exec(struct ast_channel *chan, void *data) struct localuser *u; char *status = "UNSUPPORTED"; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "SendText requires an argument (text)\n"); return -1; } diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c index 36b11f9c1..18343b786 100755 --- a/apps/app_setcallerid.c +++ b/apps/app_setcallerid.c @@ -106,7 +106,7 @@ static int setcallerid_exec(struct ast_channel *chan, void *data) char *opt; int anitoo = 0; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "SetCallerID requires an argument!\n"); return 0; } diff --git a/apps/app_setcidname.c b/apps/app_setcidname.c index 240b121dc..2dab53812 100755 --- a/apps/app_setcidname.c +++ b/apps/app_setcidname.c @@ -70,7 +70,7 @@ static int setcallerid_exec(struct ast_channel *chan, void *data) deprecation_warning = 1; } - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "SetCIDName requires an argument!\n"); return 0; } diff --git a/apps/app_skel.c b/apps/app_skel.c index 89953b440..f391cb64b 100755 --- a/apps/app_skel.c +++ b/apps/app_skel.c @@ -72,7 +72,7 @@ static int app_exec(struct ast_channel *chan, void *data) char *opts[2]; char *argv[2]; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "%s requires an argument (dummy|[options])\n",app); LOCAL_USER_REMOVE(u); return -1; @@ -96,7 +96,7 @@ static int app_exec(struct ast_channel *chan, void *data) ast_parseoptions(app_opts, &flags, opts, options); } - if (dummy && !ast_strlen_zero(dummy)) + if (!ast_strlen_zero(dummy)) ast_log(LOG_NOTICE, "Dummy value is : %s\n", dummy); if (ast_test_flag(&flags, OPTION_A)) diff --git a/apps/app_softhangup.c b/apps/app_softhangup.c index d64530f7f..66c7c412b 100755 --- a/apps/app_softhangup.c +++ b/apps/app_softhangup.c @@ -61,7 +61,7 @@ static int softhangup_exec(struct ast_channel *chan, void *data) char name[AST_CHANNEL_NAME] = ""; int all = 0; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "SoftHangup requires an argument (Technology/resource)\n"); return 0; } diff --git a/apps/app_sql_postgres.c b/apps/app_sql_postgres.c index d2b666a4f..65a0f14d2 100755 --- a/apps/app_sql_postgres.c +++ b/apps/app_sql_postgres.c @@ -504,7 +504,7 @@ static int PGSQL_exec(struct ast_channel *chan, void *data) struct localuser *u; int result; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "APP_PGSQL requires an argument (see manual)\n"); return -1; } diff --git a/apps/app_system.c b/apps/app_system.c index f1e38a3eb..76593f60f 100755 --- a/apps/app_system.c +++ b/apps/app_system.c @@ -90,7 +90,7 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode int res=0; struct localuser *u; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "System requires an argument(command)\n"); pbx_builtin_setvar_helper(chan, chanvar, "FAILURE"); return failmode; diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c index e0963e557..207d46e55 100755 --- a/apps/app_talkdetect.c +++ b/apps/app_talkdetect.c @@ -78,7 +78,7 @@ static int background_detect_exec(struct ast_channel *chan, void *data) int origrformat=0; struct ast_dsp *dsp; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "BackgroundDetect requires an argument (filename)\n"); return -1; } diff --git a/apps/app_test.c b/apps/app_test.c index cbcb05a04..8a3c8c22a 100755 --- a/apps/app_test.c +++ b/apps/app_test.c @@ -137,7 +137,7 @@ static int testclient_exec(struct ast_channel *chan, void *data) FILE *f; /* Check for test id */ - if (!testid || ast_strlen_zero(testid)) { + if (ast_strlen_zero(testid)) { ast_log(LOG_WARNING, "TestClient requires an argument - the test id\n"); return -1; } diff --git a/apps/app_transfer.c b/apps/app_transfer.c index 0333b4d1a..4b4fb1c5d 100755 --- a/apps/app_transfer.c +++ b/apps/app_transfer.c @@ -75,7 +75,7 @@ static int transfer_exec(struct ast_channel *chan, void *data) char *dest = data; char *status; - if (!dest || ast_strlen_zero(dest)) { + if (ast_strlen_zero(dest)) { ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination)\n"); pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE"); return 0; diff --git a/apps/app_txtcidname.c b/apps/app_txtcidname.c index bf39da38b..18aa0cba9 100755 --- a/apps/app_txtcidname.c +++ b/apps/app_txtcidname.c @@ -71,7 +71,7 @@ static int txtcidname_exec(struct ast_channel *chan, void *data) dep_warning = 1; } - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "TXTCIDName requires an argument (extension)\n"); res = 1; } diff --git a/apps/app_url.c b/apps/app_url.c index 4e1cc011e..d9451dba5 100755 --- a/apps/app_url.c +++ b/apps/app_url.c @@ -81,7 +81,7 @@ static int sendurl_exec(struct ast_channel *chan, void *data) char *stringp=NULL; char *status = "FAILURE"; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "SendURL requires an argument (URL)\n"); pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", status); return -1; diff --git a/apps/app_userevent.c b/apps/app_userevent.c index 5092e94e2..8fc8fcdba 100755 --- a/apps/app_userevent.c +++ b/apps/app_userevent.c @@ -66,7 +66,7 @@ static int userevent_exec(struct ast_channel *chan, void *data) char eventname[512]; char *eventbody; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "UserEvent requires an argument (eventname|optional event body)\n"); return -1; } diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 56002c734..174d17864 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2973,7 +2973,7 @@ static void adsi_message(struct ast_channel *chan, struct vm_state *vms) stringp = (char *)buf; strsep(&stringp, "="); val = strsep(&stringp, "="); - if (val && !ast_strlen_zero(val)) { + if (!ast_strlen_zero(val)) { if (!strcmp((char *)buf, "callerid")) ast_copy_string(cid, val, sizeof(cid)); if (!strcmp((char *)buf, "origdate")) @@ -3586,7 +3586,7 @@ static int play_message_category(struct ast_channel *chan, char *category) { int res = 0; - if (category && !ast_strlen_zero(category)) + if (!ast_strlen_zero(category)) res = ast_play_and_wait(chan, category); return res; @@ -4956,7 +4956,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_ if (useadsi) adsi_password(chan); - if (prefix && !ast_strlen_zero(prefix)) { + if (!ast_strlen_zero(prefix)) { char fullusername[80] = ""; ast_copy_string(fullusername, prefix, sizeof(fullusername)); strncat(fullusername, mailbox, sizeof(fullusername) - 1 - strlen(fullusername)); @@ -4987,7 +4987,7 @@ static int vm_authenticate(struct ast_channel *chan, char *mailbox, int mailbox_ else { if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "Incorrect password '%s' for user '%s' (context = %s)\n", password, mailbox, context ? context : "<any>"); - if (prefix && !ast_strlen_zero(prefix)) + if (!ast_strlen_zero(prefix)) mailbox[0] = '\0'; } logretries++; @@ -5051,7 +5051,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) if (chan->_state != AST_STATE_UP) ast_answer(chan); - if (data && !ast_strlen_zero(data)) { + if (!ast_strlen_zero(data)) { char *tmp; int argc; char *argv[2]; @@ -5127,7 +5127,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) vms.heard = calloc(vmu->maxmsg, sizeof(int)); /* Set language from config to override channel language */ - if (vmu->language && !ast_strlen_zero(vmu->language)) + if (!ast_strlen_zero(vmu->language)) ast_copy_string(chan->language, vmu->language, sizeof(chan->language)); snprintf(vms.curdir, sizeof(vms.curdir), "%s/%s", VM_SPOOL_DIR, vmu->context); mkdir(vms.curdir, 0700); @@ -5483,7 +5483,7 @@ static int vm_exec(struct ast_channel *chan, void *data) if (chan->_state != AST_STATE_UP) ast_answer(chan); - if (data && !ast_strlen_zero(data)) { + if (!ast_strlen_zero(data)) { ast_copy_string(tmp, data, sizeof(tmp)); argc = ast_separate_app_args(tmp, '|', argv, sizeof(argv) / sizeof(argv[0])); if (argc == 2) { @@ -5591,7 +5591,7 @@ static int vm_box_exists(struct ast_channel *chan, void *data) struct ast_vm_user svm; char *context, *box; - if (!data || ast_strlen_zero(data)) { + if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "MailboxExists requires an argument: (vmbox[@context])\n"); return -1; } @@ -5968,7 +5968,7 @@ static int load_config(void) ast_log(LOG_DEBUG,"VM_CID Internal context string: %s\n",s); stringp = ast_strdupa(s); for (x = 0 ; x < MAX_NUM_CID_CONTEXTS ; x++){ - if ((stringp)&&(!ast_strlen_zero(stringp))){ + if (!ast_strlen_zero(stringp)) { q = strsep(&stringp,","); while ((*q == ' ')||(*q == '\t')) /* Eat white space between contexts */ q++; diff --git a/apps/app_while.c b/apps/app_while.c index 8619294f4..5436cd3c9 100755 --- a/apps/app_while.c +++ b/apps/app_while.c @@ -249,7 +249,7 @@ static int _while_exec(struct ast_channel *chan, void *data, int end) memset(my_name, 0, size); snprintf(my_name, size, "%s_%s_%d", chan->context, chan->exten, chan->priority); - if (!label || ast_strlen_zero(label)) { + if (ast_strlen_zero(label)) { if (end) label = used_index; else if (!(label = pbx_builtin_getvar_helper(chan, my_name))) { diff --git a/apps/app_zapateller.c b/apps/app_zapateller.c index 0f764ee8d..9d3ab1209 100755 --- a/apps/app_zapateller.c +++ b/apps/app_zapateller.c @@ -68,7 +68,7 @@ static int zapateller_exec(struct ast_channel *chan, void *data) stringp=data; c = strsep(&stringp, "|"); - while(c && !ast_strlen_zero(c)) { + while(!ast_strlen_zero(c)) { if (!strcasecmp(c, "answer")) answer = 1; else if (!strcasecmp(c, "nocallerid")) diff --git a/apps/app_zapbarge.c b/apps/app_zapbarge.c index b608d9c15..d9404a4a8 100755 --- a/apps/app_zapbarge.c +++ b/apps/app_zapbarge.c @@ -269,7 +269,7 @@ static int conf_exec(struct ast_channel *chan, void *data) LOCAL_USER_ADD(u); - if (data && !ast_strlen_zero(data)) { + if (!ast_strlen_zero(data)) { if ((sscanf(data, "Zap/%d", &confno) != 1) && (sscanf(data, "%d", &confno) != 1)) { ast_log(LOG_WARNING, "ZapBarge Argument (if specified) must be a channel number, not '%s'\n", (char *)data); |