summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-05-04 14:54:42 +0000
committerMark Spencer <markster@digium.com>2004-05-04 14:54:42 +0000
commita5ad1269ef42bd302fa053d95fc8584664b163ba (patch)
treea24abdff859a43193ef8ae0dec06210f3126adb9 /config.c
parent958668f00174ef231190431ff134f95d921e8c1f (diff)
More strlen_zero checks (bug #1549)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'config.c')
-rwxr-xr-xconfig.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/config.c b/config.c
index e25b24235..574561ab3 100755
--- a/config.c
+++ b/config.c
@@ -20,6 +20,7 @@
#include <asterisk/config.h>
#include <asterisk/options.h>
#include <asterisk/logger.h>
+#include <asterisk/utils.h>
#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';