aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 14:54:42 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 14:54:42 +0000
commit3d2252c81d824df7b13198547853215b38f9e81c (patch)
treea24abdff859a43193ef8ae0dec06210f3126adb9 /config.c
parent2a9c1292282f85c8957de69bca15e11b98c7d305 (diff)
More strlen_zero checks (bug #1549)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2887 f38db490-d61c-443f-a65b-d21fe96a405b
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';