Index: apps/app_adsiprog.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_adsiprog.c,v retrieving revision 1.6 diff -u -r1.6 app_adsiprog.c --- apps/app_adsiprog.c 20 Mar 2004 17:27:10 -0000 1.6 +++ apps/app_adsiprog.c 4 May 2004 18:33:42 -0000 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -178,7 +179,7 @@ maxlen = strlen(src) - 1; memcpy(out, src, maxlen); ((char *)out)[maxlen] = '\0'; - } else if (strlen(src) && (src[0] == '\\')) { + } else if (!ast_strlen_zero(src) && (src[0] == '\\')) { if (!(argtype & ARG_NUMBER)) return -1; /* Octal value */ @@ -198,7 +199,7 @@ /* Convert */ *((unsigned int *)out) = htonl(*((unsigned int *)out)); } - } else if ((strlen(src) && isdigit(src[0]))) { + } else if ((!ast_strlen_zero(src) && isdigit(src[0]))) { if (!(argtype & ARG_NUMBER)) return -1; /* Hex value */ @@ -1363,7 +1364,7 @@ /* Strip comments */ if (c) *c = '\0'; - if (strlen(buf)) + if (!ast_strlen_zero(buf)) adsi_process(scr, buf, script, lineno); } } @@ -1540,7 +1541,7 @@ { int res=0; struct localuser *u; - if (!data || !strlen(data)) + if (!data || ast_strlen_zero(data)) data = "asterisk.adsi"; LOCAL_USER_ADD(u); if (!adsi_available(chan)) { Index: apps/app_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_agi.c,v retrieving revision 1.37 diff -u -r1.37 app_agi.c --- apps/app_agi.c 3 May 2004 00:54:15 -0000 1.37 +++ apps/app_agi.c 4 May 2004 18:33:43 -0000 @@ -36,6 +36,7 @@ #include #include #include +#include #include "../asterisk.h" #include "../astconf.h" @@ -1465,7 +1466,7 @@ int pid; char *stringp; AGI agi; - if (!data || !strlen(data)) { + if (!data || ast_strlen_zero(data)) { ast_log(LOG_WARNING, "AGI requires an argument (script)\n"); return -1; } Index: apps/app_dial.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_dial.c,v retrieving revision 1.63 diff -u -r1.63 app_dial.c --- apps/app_dial.c 27 Apr 2004 16:42:43 -0000 1.63 +++ apps/app_dial.c 4 May 2004 18:33:43 -0000 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -201,7 +202,7 @@ *allowdisconnect = o->allowdisconnect; } } else if (o->chan && (o->chan == winner)) { - if (strlen(o->chan->call_forward)) { + if (!ast_strlen_zero(o->chan->call_forward)) { char tmpchan[256]; /* Before processing channel, go ahead and check for forwarding */ if (option_verbose > 2) @@ -235,7 +236,7 @@ } if (o->chan->rdnis) free(o->chan->rdnis); - if (strlen(in->macroexten)) + if (!ast_strlen_zero(in->macroexten)) o->chan->rdnis = strdup(in->macroexten); else o->chan->rdnis = strdup(in->exten); @@ -445,7 +446,7 @@ } } else timeout = NULL; - if (!peers || !strlen(peers)) { + if (!peers || ast_strlen_zero(peers)) { ast_log(LOG_WARNING, "Dial argument takes format (technology1/number1&technology2/number2...|optional timeout)\n"); goto out; } @@ -581,7 +582,7 @@ } if (resetcdr && chan->cdr) ast_cdr_reset(chan->cdr, 0); - if (!strlen(privdb) && privacy) { + if (ast_strlen_zero(privdb) && privacy) { /* If privdb is not specified and we are using privacy, copy from extension */ strncpy(privdb, chan->exten, sizeof(privdb) - 1); } @@ -658,7 +659,7 @@ cur = rest; continue; } - if (strlen(tmp->chan->call_forward)) { + if (!ast_strlen_zero(tmp->chan->call_forward)) { char tmpchan[256]; if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Forwarding call to '%s@%s'\n", tmp->chan->call_forward, tmp->chan->context); @@ -721,7 +722,7 @@ tmp->chan->callerid = NULL; /* Copy language from incoming to outgoing */ strcpy(tmp->chan->language, chan->language); - if (!strlen(tmp->chan->musicclass)) + if (ast_strlen_zero(tmp->chan->musicclass)) strncpy(tmp->chan->musicclass, chan->musicclass, sizeof(tmp->chan->musicclass) - 1); if (chan->ani) tmp->chan->ani = strdup(chan->ani); @@ -768,7 +769,7 @@ cur = rest; } while(cur); - if (timeout && strlen(timeout)) { + if (timeout && !ast_strlen_zero(timeout)) { to = atoi(timeout); if (to > 0) to *= 1000; @@ -808,7 +809,7 @@ return -1; } /* JDG: sendurl */ - if( url && strlen(url) && ast_channel_supports_html(peer) ) { + if( url && !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 */ Index: apps/app_authenticate.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_authenticate.c,v retrieving revision 1.3 diff -u -r1.3 app_authenticate.c --- apps/app_authenticate.c 29 Jan 2004 20:54:37 -0000 1.3 +++ apps/app_authenticate.c 4 May 2004 18:33:43 -0000 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -63,7 +64,7 @@ char passwd[256]; char *opts; char *prompt; - if (!data || !strlen(data)) { + if (!data || ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Authenticate requires an argument(password)\n"); return -1; } @@ -108,14 +109,14 @@ char buf[256] = ""; while(!feof(f)) { fgets(buf, sizeof(buf), f); - if (!feof(f) && strlen(buf)) { + if (!feof(f) && !ast_strlen_zero(buf)) { buf[strlen(buf) - 1] = '\0'; - if (strlen(buf) && !strcmp(passwd, buf)) + if (!ast_strlen_zero(buf) && !strcmp(passwd, buf)) break; } } fclose(f); - if (strlen(buf) && !strcmp(passwd, buf)) + if (!ast_strlen_zero(buf) && !strcmp(passwd, buf)) break; } else ast_log(LOG_WARNING, "Unable to open file '%s' for authentication: %s\n", password, strerror(errno));