aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-26 18:54:24 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-26 18:54:24 +0000
commit1168964aa44ffe50af7f08aaae9fc1bbc90e7784 (patch)
treec0ffbb2fbd1dd819c7587a31da636ca6f4ae71c0 /app.c
parentdb653f9eb1553a706ec819af67d84e261df14a26 (diff)
change ast_strlen_zero to also check for the string to be defined
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6862 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rwxr-xr-xapp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/app.c b/app.c
index 168af68cd..18bb0ce86 100755
--- a/app.c
+++ b/app.c
@@ -393,7 +393,7 @@ int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, in
int res = -1;
int autoclose = 0;
if (fd < 0) {
- if (!filename || ast_strlen_zero(filename))
+ if (ast_strlen_zero(filename))
return -1;
autoclose = 1;
if (filename[0] == '/')
@@ -998,7 +998,7 @@ int ast_app_group_split_group(char *data, char *group, int group_max, char *cate
char tmp[256];
char *grp=NULL, *cat=NULL;
- if (data && !ast_strlen_zero(data)) {
+ if (!ast_strlen_zero(data)) {
ast_copy_string(tmp, data, sizeof(tmp));
grp = tmp;
cat = strchr(tmp, '@');
@@ -1008,7 +1008,7 @@ int ast_app_group_split_group(char *data, char *group, int group_max, char *cate
}
}
- if (grp && !ast_strlen_zero(grp))
+ if (!ast_strlen_zero(grp))
ast_copy_string(group, grp, group_max);
else
res = -1;
@@ -1043,10 +1043,10 @@ int ast_app_group_get_count(char *group, char *category)
char cat[80];
char *s;
- if (group == NULL || ast_strlen_zero(group))
+ if (ast_strlen_zero(group))
return 0;
- s = (category && !ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
+ s = (!ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
ast_copy_string(cat, s, sizeof(cat));
chan = NULL;
@@ -1069,14 +1069,14 @@ int ast_app_group_match_get_count(char *groupmatch, char *category)
char cat[80];
char *s;
- if (!groupmatch || ast_strlen_zero(groupmatch))
+ if (ast_strlen_zero(groupmatch))
return 0;
/* if regex compilation fails, return zero matches */
if (regcomp(&regexbuf, groupmatch, REG_EXTENDED | REG_NOSUB))
return 0;
- s = (category && !ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
+ s = (!ast_strlen_zero(category)) ? category : GROUP_CATEGORY_PREFIX;
ast_copy_string(cat, s, sizeof(cat));
chan = NULL;