Index: say.c =================================================================== RCS file: /usr/cvsroot/asterisk/say.c,v retrieving revision 1.24 diff -u -r1.24 say.c --- say.c 3 May 2004 21:10:57 -0000 1.24 +++ say.c 4 May 2004 06:30:41 -0000 @@ -23,6 +23,7 @@ #include #include #include +#include #include "asterisk.h" #include @@ -50,7 +51,7 @@ snprintf(fn, sizeof(fn), "digits/%c", fn2[num]); } } - if(strlen(fn)){ /* if length == 0, then skip this digit as it is invalid */ + if(!ast_strlen_zero(fn)){ /* if length == 0, then skip this digit as it is invalid */ res = ast_streamfile(chan, fn, lang); if (!res) res = ast_waitstream(chan, ints); @@ -121,7 +122,7 @@ if ('A' <= ltr && ltr <= 'Z') ltr += 'a' - 'A'; /* file names are all lower-case */ snprintf(fn, sizeof(fn), "letters/%c", ltr); } - if(strlen(fn)){ /* if length == 0, then skip this digit as it is invalid */ + if(!ast_strlen_zero(fn)) { /* if length == 0, then skip this digit as it is invalid */ res = ast_streamfile(chan, fn, lang); if (!res) res = ast_waitstream(chan, ints); @@ -192,7 +193,7 @@ case ('%'): play=0; /* check if we have 2 chars after the % */ - if (strlen(fn2)>num+2) + if (strlen(fn2) > num+2) { hex[0]=fn2[num+1]; hex[1]=fn2[num+2]; Index: config.c =================================================================== RCS file: /usr/cvsroot/asterisk/config.c,v retrieving revision 1.17 diff -u -r1.17 config.c --- config.c 2 Mar 2004 07:57:05 -0000 1.17 +++ config.c 4 May 2004 06:30:41 -0000 @@ -20,6 +20,7 @@ #include #include #include +#include #include "asterisk.h" #include "astconf.h" @@ -57,7 +58,7 @@ { char *start; /* Strip off trailing whitespace, returns, etc */ - while(strlen(buf) && (buf[strlen(buf)-1]<33)) + while(!ast_strlen_zero(buf) && (buf[strlen(buf)-1]<33)) buf[strlen(buf)-1] = '\0'; start = buf; /* Strip off leading whitespace, returns, etc */ @@ -469,7 +470,7 @@ #endif } cur = strip(buf); - if (strlen(cur)) { + if (!ast_strlen_zero(cur)) { /* Actually parse the entry */ if (cur[0] == '[') { /* A category header */ @@ -525,7 +526,7 @@ while((*c == '<') || (*c == '>') || (*c == '\"')) c++; /* Get rid of leading mess */ cur = c; - while(strlen(cur)) { + while(!ast_strlen_zero(cur)) { c = cur + strlen(cur) - 1; if ((*c == '>') || (*c == '<') || (*c == '\"')) *c = '\0'; Index: srv.c =================================================================== RCS file: /usr/cvsroot/asterisk/srv.c,v retrieving revision 1.7 diff -u -r1.7 srv.c --- srv.c 3 Mar 2004 03:12:59 -0000 1.7 +++ srv.c 4 May 2004 06:30:41 -0000 @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef __APPLE__ #undef T_SRV @@ -84,7 +85,7 @@ return -1; } - if (strlen(c->host)) + if (!ast_strlen_zero(c->host)) return 1; return 0; Index: enum.c =================================================================== RCS file: /usr/cvsroot/asterisk/enum.c,v retrieving revision 1.15 diff -u -r1.15 enum.c --- enum.c 3 Mar 2004 03:12:59 -0000 1.15 +++ enum.c 4 May 2004 06:30:41 -0000 @@ -32,6 +32,7 @@ #include #include #include +#include #ifdef __APPLE__ #undef T_NAPTR @@ -237,7 +238,7 @@ return -1; } - if (strlen(c->dst)) + if (!ast_strlen_zero(c->dst)) return 1; return 0; Index: asterisk.c =================================================================== RCS file: /usr/cvsroot/asterisk/asterisk.c,v retrieving revision 1.80 diff -u -r1.80 asterisk.c --- asterisk.c 3 May 2004 00:54:15 -0000 1.80 +++ asterisk.c 4 May 2004 06:30:42 -0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -546,7 +547,7 @@ if (option_console || option_remote) { if (getenv("HOME")) snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME")); - if (strlen(filename)) + if (!ast_strlen_zero(filename)) ast_el_write_history(filename); if (el != NULL) el_end(el); @@ -640,7 +641,7 @@ printf(term_end()); fflush(stdout); /* Called when readline data is available */ - if (s && strlen(s)) + if (s && !ast_strlen_zero(s)) ast_el_add_history(s); /* Give the console access to the shell */ if (s) { @@ -660,7 +661,7 @@ { int ret = 0; /* Called when readline data is available */ - if (s && strlen(s)) + if (s && !ast_strlen_zero(s)) ast_el_add_history(s); /* Give the console access to the shell */ if (s) { @@ -1334,7 +1335,7 @@ el_set(el, EL_GETCFN, ast_el_read_char); - if (strlen(filename)) + if (!ast_strlen_zero(filename)) ast_el_read_history(filename); ast_cli_register(&quit); @@ -1350,7 +1351,7 @@ for(;;) { ebuf = (char *)el_gets(el, &num); - if (ebuf && strlen(ebuf)) { + if (ebuf && !ast_strlen_zero(ebuf)) { if (ebuf[strlen(ebuf)-1] == '\n') ebuf[strlen(ebuf)-1] = '\0'; if (!remoteconsolehandler(ebuf)) { @@ -1555,7 +1556,7 @@ if (el_hist == NULL || el == NULL) ast_el_initialize(); - if (strlen(filename)) + if (!ast_strlen_zero(filename)) ast_el_read_history(filename); }