From a5ad1269ef42bd302fa053d95fc8584664b163ba Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Tue, 4 May 2004 14:54:42 +0000 Subject: More strlen_zero checks (bug #1549) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2887 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- config.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index e25b24235..574561ab3 100755 --- a/config.c +++ b/config.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "asterisk.h" #include "astconf.h" @@ -57,7 +58,7 @@ static char *strip(char *buf) { 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 @@ static int cfg_process(struct ast_config *tmp, struct ast_category **_tmpc, stru #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 @@ static int cfg_process(struct ast_config *tmp, struct ast_category **_tmpc, stru 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'; -- cgit v1.2.3