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
This commit is contained in:
parent
db653f9eb1
commit
1168964aa4
14
app.c
14
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(®exbuf, 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;
|
||||
|
|
|
@ -1704,7 +1704,7 @@ static void ast_remotecontrol(char * data)
|
|||
for(;;) {
|
||||
ebuf = (char *)el_gets(el, &num);
|
||||
|
||||
if (ebuf && !ast_strlen_zero(ebuf)) {
|
||||
if (!ast_strlen_zero(ebuf)) {
|
||||
if (ebuf[strlen(ebuf)-1] == '\n')
|
||||
ebuf[strlen(ebuf)-1] = '\0';
|
||||
if (!remoteconsolehandler(ebuf)) {
|
||||
|
|
13
callerid.c
13
callerid.c
|
@ -429,7 +429,7 @@ static int callerid_genmsg(char *msg, int size, char *number, char *name, int fl
|
|||
tm.tm_mday, tm.tm_hour, tm.tm_min);
|
||||
size -= res;
|
||||
ptr += res;
|
||||
if (!number || ast_strlen_zero(number) || (flags & CID_UNKNOWN_NUMBER)) {
|
||||
if (ast_strlen_zero(number) || (flags & CID_UNKNOWN_NUMBER)) {
|
||||
/* Indicate number not known */
|
||||
res = snprintf(ptr, size, "\004\001O");
|
||||
size -= res;
|
||||
|
@ -453,7 +453,7 @@ static int callerid_genmsg(char *msg, int size, char *number, char *name, int fl
|
|||
size -= i;
|
||||
}
|
||||
|
||||
if (!name || ast_strlen_zero(name) || (flags & CID_UNKNOWN_NAME)) {
|
||||
if (ast_strlen_zero(name) || (flags & CID_UNKNOWN_NAME)) {
|
||||
/* Indicate name not known */
|
||||
res = snprintf(ptr, size, "\010\001O");
|
||||
size -= res;
|
||||
|
@ -617,7 +617,7 @@ void ast_shrink_phone_number(char *n)
|
|||
int ast_isphonenumber(char *n)
|
||||
{
|
||||
int x;
|
||||
if (!n || ast_strlen_zero(n))
|
||||
if (ast_strlen_zero(n))
|
||||
return 0;
|
||||
for (x=0;n[x];x++)
|
||||
if (!strchr("0123456789*#+", n[x]))
|
||||
|
@ -649,8 +649,7 @@ int ast_callerid_parse(char *instr, char **name, char **location)
|
|||
while(!ast_strlen_zero(instr) && (instr[strlen(instr) - 1] < 33))
|
||||
instr[strlen(instr) - 1] = '\0';
|
||||
/* And leading spaces */
|
||||
while(**name && (**name < 33))
|
||||
(*name)++;
|
||||
*name = ast_skip_blanks(*name);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
@ -675,9 +674,9 @@ int ast_callerid_parse(char *instr, char **name, char **location)
|
|||
|
||||
static int __ast_callerid_generate(unsigned char *buf, char *name, char *number, int callwaiting, int codec)
|
||||
{
|
||||
if (name && ast_strlen_zero(name))
|
||||
if (ast_strlen_zero(name))
|
||||
name = NULL;
|
||||
if (number && ast_strlen_zero(number))
|
||||
if (ast_strlen_zero(number))
|
||||
number = NULL;
|
||||
return callerid_generate(buf, number, name, 0, callwaiting, codec);
|
||||
}
|
||||
|
|
2
cdr.c
2
cdr.c
|
@ -179,7 +179,7 @@ static const char *ast_cdr_getvar_internal(struct ast_cdr *cdr, const char *name
|
|||
struct ast_var_t *variables;
|
||||
struct varshead *headp;
|
||||
|
||||
if (!name || ast_strlen_zero(name))
|
||||
if (ast_strlen_zero(name))
|
||||
return NULL;
|
||||
|
||||
while (cdr) {
|
||||
|
|
3
config.c
3
config.c
|
@ -631,11 +631,12 @@ static struct ast_config *config_text_file_load(const char *database, const char
|
|||
}
|
||||
if (process_buf) {
|
||||
char *buf = ast_strip(process_buf);
|
||||
if (!ast_strlen_zero(buf))
|
||||
if (!ast_strlen_zero(buf)) {
|
||||
if (process_text_line(cfg, &cat, buf, lineno, filename)) {
|
||||
cfg = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
6
db.c
6
db.c
|
@ -400,8 +400,8 @@ struct ast_db_entry *ast_db_gettree(const char *family, const char *keytree)
|
|||
struct ast_db_entry *last = NULL;
|
||||
struct ast_db_entry *cur, *ret=NULL;
|
||||
|
||||
if (family && !ast_strlen_zero(family)) {
|
||||
if (keytree && !ast_strlen_zero(keytree)) {
|
||||
if (!ast_strlen_zero(family)) {
|
||||
if (!ast_strlen_zero(keytree)) {
|
||||
/* Family and key tree */
|
||||
snprintf(prefix, sizeof(prefix), "/%s/%s", family, prefix);
|
||||
} else {
|
||||
|
@ -557,7 +557,7 @@ static int manager_dbget(struct mansession *s, struct message *m)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
snprintf(idText, sizeof(idText) ,"ActionID: %s\r\n", id);
|
||||
|
||||
res = ast_db_get(family, key, tmp, sizeof(tmp));
|
||||
|
|
4
dnsmgr.c
4
dnsmgr.c
|
@ -82,7 +82,7 @@ struct ast_dnsmgr_entry *ast_dnsmgr_get(const char *name, struct in_addr *result
|
|||
{
|
||||
struct ast_dnsmgr_entry *entry;
|
||||
|
||||
if (!name || !result || ast_strlen_zero(name))
|
||||
if (!result || ast_strlen_zero(name))
|
||||
return NULL;
|
||||
|
||||
entry = calloc(1, sizeof(*entry) + strlen(name));
|
||||
|
@ -112,7 +112,7 @@ void ast_dnsmgr_release(struct ast_dnsmgr_entry *entry)
|
|||
|
||||
int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmgr_entry **dnsmgr)
|
||||
{
|
||||
if (!name || ast_strlen_zero(name) || !result || !dnsmgr)
|
||||
if (ast_strlen_zero(name) || !result || !dnsmgr)
|
||||
return -1;
|
||||
|
||||
if (*dnsmgr && !strcasecmp((*dnsmgr)->name, name))
|
||||
|
|
6
file.c
6
file.c
|
@ -489,7 +489,7 @@ struct ast_filestream *ast_openstream_full(struct ast_channel *chan, const char
|
|||
if (chan->generator)
|
||||
ast_deactivate_generator(chan);
|
||||
}
|
||||
if (preflang && !ast_strlen_zero(preflang)) {
|
||||
if (!ast_strlen_zero(preflang)) {
|
||||
ast_copy_string(filename3, filename, sizeof(filename3));
|
||||
endpart = strrchr(filename3, '/');
|
||||
if (endpart) {
|
||||
|
@ -538,7 +538,7 @@ struct ast_filestream *ast_openvstream(struct ast_channel *chan, const char *fil
|
|||
char lang2[MAX_LANGUAGE];
|
||||
/* XXX H.263 only XXX */
|
||||
char *fmt = "h263";
|
||||
if (preflang && !ast_strlen_zero(preflang)) {
|
||||
if (!ast_strlen_zero(preflang)) {
|
||||
snprintf(filename2, sizeof(filename2), "%s/%s", preflang, filename);
|
||||
fmts = ast_fileexists(filename2, fmt, NULL);
|
||||
if (fmts < 1) {
|
||||
|
@ -739,7 +739,7 @@ int ast_fileexists(const char *filename, const char *fmt, const char *preflang)
|
|||
char *c;
|
||||
char lang2[MAX_LANGUAGE];
|
||||
int res = -1;
|
||||
if (preflang && !ast_strlen_zero(preflang)) {
|
||||
if (!ast_strlen_zero(preflang)) {
|
||||
/* Insert the language between the last two parts of the path */
|
||||
ast_copy_string(tmp, filename, sizeof(tmp));
|
||||
c = strrchr(tmp, '/');
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
static inline int ast_strlen_zero(const char *s)
|
||||
{
|
||||
return (*s == '\0');
|
||||
return (!s || (*s == '\0'));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
40
manager.c
40
manager.c
|
@ -348,7 +348,7 @@ void astman_send_error(struct mansession *s, struct message *m, char *error)
|
|||
char *id = astman_get_header(m,"ActionID");
|
||||
|
||||
ast_cli(s->fd, "Response: Error\r\n");
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
ast_cli(s->fd, "ActionID: %s\r\n",id);
|
||||
ast_cli(s->fd, "Message: %s\r\n\r\n", error);
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ void astman_send_response(struct mansession *s, struct message *m, char *resp, c
|
|||
char *id = astman_get_header(m,"ActionID");
|
||||
|
||||
ast_cli(s->fd, "Response: %s\r\n", resp);
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
ast_cli(s->fd, "ActionID: %s\r\n",id);
|
||||
if (msg)
|
||||
ast_cli(s->fd, "Message: %s\r\n\r\n", msg);
|
||||
|
@ -433,7 +433,7 @@ static int ast_strings_to_mask(char *string)
|
|||
|
||||
if (x) {
|
||||
ret = x;
|
||||
} else if (!string || ast_strlen_zero(string)) {
|
||||
} else if (ast_strlen_zero(string)) {
|
||||
ret = -1;
|
||||
} else if (ast_false(string)) {
|
||||
ret = 0;
|
||||
|
@ -517,7 +517,7 @@ static int authenticate(struct mansession *s, struct message *m)
|
|||
} else if (ha)
|
||||
ast_free_ha(ha);
|
||||
if (!strcasecmp(authtype, "MD5")) {
|
||||
if (key && !ast_strlen_zero(key) && s->challenge) {
|
||||
if (!ast_strlen_zero(key) && s->challenge) {
|
||||
int x;
|
||||
int len=0;
|
||||
char md5key[256] = "";
|
||||
|
@ -584,7 +584,7 @@ static int action_listcommands(struct mansession *s, struct message *m)
|
|||
char temp[BUFSIZ];
|
||||
char *id = astman_get_header(m,"ActionID");
|
||||
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
snprintf(idText,256,"ActionID: %s\r\n",id);
|
||||
ast_cli(s->fd, "Response: Success\r\n%s", idText);
|
||||
ast_mutex_lock(&actionlock);
|
||||
|
@ -729,7 +729,7 @@ static int action_getvar(struct mansession *s, struct message *m)
|
|||
ast_mutex_unlock(&c->lock);
|
||||
ast_cli(s->fd, "Response: Success\r\n"
|
||||
"Variable: %s\r\nValue: %s\r\n" ,varname,varval2);
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
ast_cli(s->fd, "ActionID: %s\r\n",id);
|
||||
ast_cli(s->fd, "\r\n");
|
||||
|
||||
|
@ -748,10 +748,10 @@ static int action_status(struct mansession *s, struct message *m)
|
|||
char bridge[256];
|
||||
struct timeval now = ast_tvnow();
|
||||
long elapsed_seconds=0;
|
||||
int all = !name || ast_strlen_zero(name); /* set if we want all channels */
|
||||
int all = ast_strlen_zero(name); /* set if we want all channels */
|
||||
|
||||
astman_send_ack(s, m, "Channel status will follow");
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
snprintf(idText,256,"ActionID: %s\r\n",id);
|
||||
if (all)
|
||||
c = ast_channel_walk_locked(NULL);
|
||||
|
@ -847,7 +847,7 @@ static int action_redirect(struct mansession *s, struct message *m)
|
|||
int pi = 0;
|
||||
int res;
|
||||
|
||||
if (!name || ast_strlen_zero(name)) {
|
||||
if (ast_strlen_zero(name)) {
|
||||
astman_send_error(s, m, "Channel not specified");
|
||||
return 0;
|
||||
}
|
||||
|
@ -898,7 +898,7 @@ static int action_command(struct mansession *s, struct message *m)
|
|||
char *cmd = astman_get_header(m, "Command");
|
||||
char *id = astman_get_header(m, "ActionID");
|
||||
ast_cli(s->fd, "Response: Follows\r\nPrivilege: Command\r\n");
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
ast_cli(s->fd, "ActionID: %s\r\n", id);
|
||||
/* FIXME: Wedge a ActionID response in here, waiting for later changes */
|
||||
ast_cli_command(s->fd, cmd);
|
||||
|
@ -1037,7 +1037,7 @@ static int action_originate(struct mansession *s, struct message *m)
|
|||
res = -1;
|
||||
} else {
|
||||
memset(fast, 0, sizeof(struct fast_originate_helper));
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
snprintf(fast->idtext, sizeof(fast->idtext), "ActionID: %s\r\n", id);
|
||||
ast_copy_string(fast->tech, tech, sizeof(fast->tech));
|
||||
ast_copy_string(fast->data, data, sizeof(fast->data));
|
||||
|
@ -1093,11 +1093,11 @@ static int action_mailboxstatus(struct mansession *s, struct message *m)
|
|||
char *id = astman_get_header(m,"ActionID");
|
||||
char idText[256] = "";
|
||||
int ret;
|
||||
if (!mailbox || ast_strlen_zero(mailbox)) {
|
||||
if (ast_strlen_zero(mailbox)) {
|
||||
astman_send_error(s, m, "Mailbox not specified");
|
||||
return 0;
|
||||
}
|
||||
if (id && !ast_strlen_zero(id))
|
||||
if (!ast_strlen_zero(id))
|
||||
snprintf(idText,256,"ActionID: %s\r\n",id);
|
||||
ret = ast_app_has_voicemail(mailbox, NULL);
|
||||
ast_cli(s->fd, "Response: Success\r\n"
|
||||
|
@ -1125,12 +1125,12 @@ static int action_mailboxcount(struct mansession *s, struct message *m)
|
|||
char *id = astman_get_header(m,"ActionID");
|
||||
char idText[256] = "";
|
||||
int newmsgs = 0, oldmsgs = 0;
|
||||
if (!mailbox || ast_strlen_zero(mailbox)) {
|
||||
if (ast_strlen_zero(mailbox)) {
|
||||
astman_send_error(s, m, "Mailbox not specified");
|
||||
return 0;
|
||||
}
|
||||
ast_app_messagecount(mailbox, &newmsgs, &oldmsgs);
|
||||
if (id && !ast_strlen_zero(id)) {
|
||||
if (!ast_strlen_zero(id)) {
|
||||
snprintf(idText,256,"ActionID: %s\r\n",id);
|
||||
}
|
||||
ast_cli(s->fd, "Response: Success\r\n"
|
||||
|
@ -1163,15 +1163,15 @@ static int action_extensionstate(struct mansession *s, struct message *m)
|
|||
char idText[256] = "";
|
||||
char hint[256] = "";
|
||||
int status;
|
||||
if (!exten || ast_strlen_zero(exten)) {
|
||||
if (ast_strlen_zero(exten)) {
|
||||
astman_send_error(s, m, "Extension not specified");
|
||||
return 0;
|
||||
}
|
||||
if (!context || ast_strlen_zero(context))
|
||||
if (ast_strlen_zero(context))
|
||||
context = "default";
|
||||
status = ast_extension_state(NULL, context, exten);
|
||||
ast_get_hint(hint, sizeof(hint) - 1, NULL, 0, NULL, context, exten);
|
||||
if (id && !ast_strlen_zero(id)) {
|
||||
if (!ast_strlen_zero(id)) {
|
||||
snprintf(idText,256,"ActionID: %s\r\n",id);
|
||||
}
|
||||
ast_cli(s->fd, "Response: Success\r\n"
|
||||
|
@ -1231,7 +1231,7 @@ static int process_message(struct mansession *s, struct message *m)
|
|||
astman_send_error(s, m, "Missing action in request");
|
||||
return 0;
|
||||
}
|
||||
if (id && !ast_strlen_zero(id)) {
|
||||
if (!ast_strlen_zero(id)) {
|
||||
snprintf(idText,256,"ActionID: %s\r\n",id);
|
||||
}
|
||||
if (!s->authenticated) {
|
||||
|
@ -1239,7 +1239,7 @@ static int process_message(struct mansession *s, struct message *m)
|
|||
char *authtype;
|
||||
authtype = astman_get_header(m, "AuthType");
|
||||
if (!strcasecmp(authtype, "MD5")) {
|
||||
if (!s->challenge || ast_strlen_zero(s->challenge))
|
||||
if (ast_strlen_zero(s->challenge))
|
||||
snprintf(s->challenge, sizeof(s->challenge), "%d", rand());
|
||||
ast_mutex_lock(&s->__lock);
|
||||
ast_cli(s->fd, "Response: Success\r\n"
|
||||
|
|
34
pbx.c
34
pbx.c
|
@ -4528,9 +4528,9 @@ int ast_explicit_goto(struct ast_channel *chan, const char *context, const char
|
|||
if (!chan)
|
||||
return -1;
|
||||
|
||||
if (context && !ast_strlen_zero(context))
|
||||
if (!ast_strlen_zero(context))
|
||||
ast_copy_string(chan->context, context, sizeof(chan->context));
|
||||
if (exten && !ast_strlen_zero(exten))
|
||||
if (!ast_strlen_zero(exten))
|
||||
ast_copy_string(chan->exten, exten, sizeof(chan->exten));
|
||||
if (priority > -1) {
|
||||
chan->priority = priority;
|
||||
|
@ -4566,8 +4566,8 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex
|
|||
tmpchan->writeformat = chan->writeformat;
|
||||
/* Setup proper location */
|
||||
ast_explicit_goto(tmpchan,
|
||||
(context && !ast_strlen_zero(context)) ? context : chan->context,
|
||||
(exten && !ast_strlen_zero(exten)) ? exten : chan->exten,
|
||||
(!ast_strlen_zero(context)) ? context : chan->context,
|
||||
(!ast_strlen_zero(exten)) ? exten : chan->exten,
|
||||
priority);
|
||||
|
||||
/* Masquerade into temp channel */
|
||||
|
@ -5053,7 +5053,7 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
|
|||
chan = ast_channel_alloc(0);
|
||||
if (chan) {
|
||||
ast_copy_string(chan->name, "OutgoingSpoolFailed", sizeof(chan->name));
|
||||
if (context && !ast_strlen_zero(context))
|
||||
if (!ast_strlen_zero(context))
|
||||
ast_copy_string(chan->context, context, sizeof(chan->context));
|
||||
ast_copy_string(chan->exten, "failed", sizeof(chan->exten));
|
||||
chan->priority = 1;
|
||||
|
@ -5142,7 +5142,7 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout,
|
|||
|
||||
if (locked_channel)
|
||||
*locked_channel = NULL;
|
||||
if (!app || ast_strlen_zero(app)) {
|
||||
if (ast_strlen_zero(app)) {
|
||||
res = -1;
|
||||
goto outgoing_app_cleanup;
|
||||
}
|
||||
|
@ -5496,7 +5496,7 @@ static int pbx_builtin_prefix(struct ast_channel *chan, void *data)
|
|||
{
|
||||
char newexten[AST_MAX_EXTENSION];
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_DEBUG, "Ignoring, since there is no prefix to add\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -5511,7 +5511,7 @@ static int pbx_builtin_suffix(struct ast_channel *chan, void *data)
|
|||
{
|
||||
char newexten[AST_MAX_EXTENSION];
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_DEBUG, "Ignoring, since there is no suffix to add\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -5528,7 +5528,7 @@ static int pbx_builtin_gotoiftime(struct ast_channel *chan, void *data)
|
|||
char *s, *ts;
|
||||
struct ast_timing timing;
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "GotoIfTime requires an argument:\n <time range>|<days of week>|<days of month>|<months>?[[context|]extension|]priority\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -5556,7 +5556,7 @@ static int pbx_builtin_execiftime(struct ast_channel *chan, void *data)
|
|||
struct ast_app *app;
|
||||
const char *usage = "ExecIfTime requires an argument:\n <time range>|<days of week>|<days of month>|<months>?<appname>[|<appargs>]";
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "%s\n", usage);
|
||||
return -1;
|
||||
}
|
||||
|
@ -5943,7 +5943,7 @@ int pbx_builtin_setvar(struct ast_channel *chan, void *data)
|
|||
int global = 0;
|
||||
int x;
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "Set requires at least one variable name/value pair.\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -5981,7 +5981,7 @@ int pbx_builtin_importvar(struct ast_channel *chan, void *data)
|
|||
char tmp[VAR_BUF_SIZE]="";
|
||||
char *s;
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "Ignoring, since there is no variable to set\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -6012,7 +6012,7 @@ static int pbx_builtin_setglobalvar(struct ast_channel *chan, void *data)
|
|||
char *value;
|
||||
char *stringp = NULL;
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "Ignoring, since there is no variable to set\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -6067,7 +6067,7 @@ static int pbx_builtin_gotoif(struct ast_channel *chan, void *data)
|
|||
int rc;
|
||||
char *stringp=NULL;
|
||||
|
||||
if (!data || ast_strlen_zero(data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "Ignoring, since there is no variable to check\n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -6079,7 +6079,7 @@ static int pbx_builtin_gotoif(struct ast_channel *chan, void *data)
|
|||
branch2=strsep(&stringp,"");
|
||||
branch = pbx_checkcondition(condition) ? branch1 : branch2;
|
||||
|
||||
if ((branch==NULL) || ast_strlen_zero(branch)) {
|
||||
if (ast_strlen_zero(branch)) {
|
||||
ast_log(LOG_DEBUG, "Not taking any branch\n");
|
||||
return(0);
|
||||
}
|
||||
|
@ -6097,7 +6097,7 @@ static int pbx_builtin_saynumber(struct ast_channel *chan, void *data)
|
|||
char *options = (char *) NULL;
|
||||
|
||||
|
||||
if (!data || ast_strlen_zero((char *)data)) {
|
||||
if (ast_strlen_zero(data)) {
|
||||
ast_log(LOG_WARNING, "SayNumber requires an argument (number)\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -6387,7 +6387,7 @@ int ast_parseable_goto(struct ast_channel *chan, const char *goto_string)
|
|||
int ipri;
|
||||
int mode = 0;
|
||||
|
||||
if (!goto_string || ast_strlen_zero(goto_string)) {
|
||||
if (ast_strlen_zero(goto_string)) {
|
||||
ast_log(LOG_WARNING, "Goto requires an argument (optional context|optional extension|priority)\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
4
utils.c
4
utils.c
|
@ -570,7 +570,7 @@ int ast_build_string(char **buffer, size_t *space, const char *fmt, ...)
|
|||
|
||||
int ast_true(const char *s)
|
||||
{
|
||||
if (!s || ast_strlen_zero(s))
|
||||
if (ast_strlen_zero(s))
|
||||
return 0;
|
||||
|
||||
/* Determine if this is a true value */
|
||||
|
@ -587,7 +587,7 @@ int ast_true(const char *s)
|
|||
|
||||
int ast_false(const char *s)
|
||||
{
|
||||
if (!s || ast_strlen_zero(s))
|
||||
if (ast_strlen_zero(s))
|
||||
return 0;
|
||||
|
||||
/* Determine if this is a false value */
|
||||
|
|
Reference in New Issue