change ast_strlen_zero to also check for the string to be defined

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-10-26 18:54:24 +00:00
parent b5326f99fc
commit a736096e0b
12 changed files with 65 additions and 65 deletions

14
app.c
View File

@@ -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;