aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_adsiprog.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 19:11:25 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 19:11:25 +0000
commit5d7c4bb03e33da0be5f91f34313498f3773ef1e3 (patch)
tree6b28979729f7e9ea49043ca3e54b7889d188209f /apps/app_adsiprog.c
parent3047e6772d30c76768a9cf9cce54714cad2c7f6d (diff)
strlen fixes and don't destroy SIP channels that still have pending things on them (bug #1552 et al)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2890 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_adsiprog.c')
-rwxr-xr-xapps/app_adsiprog.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index 12742609d..2fa21f0eb 100755
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -19,6 +19,7 @@
#include <asterisk/module.h>
#include <asterisk/adsi.h>
#include <asterisk/options.h>
+#include <asterisk/utils.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <unistd.h>
@@ -178,7 +179,7 @@ static int process_token(void *out, char *src, int maxlen, int argtype)
maxlen = strlen(src) - 1;
memcpy(out, src, maxlen);
((char *)out)[maxlen] = '\0';
- } else if (strlen(src) && (src[0] == '\\')) {
+ } else if (!ast_strlen_zero(src) && (src[0] == '\\')) {
if (!(argtype & ARG_NUMBER))
return -1;
/* Octal value */
@@ -198,7 +199,7 @@ static int process_token(void *out, char *src, int maxlen, int argtype)
/* Convert */
*((unsigned int *)out) = htonl(*((unsigned int *)out));
}
- } else if ((strlen(src) && isdigit(src[0]))) {
+ } else if ((!ast_strlen_zero(src) && isdigit(src[0]))) {
if (!(argtype & ARG_NUMBER))
return -1;
/* Hex value */
@@ -1363,7 +1364,7 @@ static struct adsi_script *compile_script(char *script)
/* Strip comments */
if (c)
*c = '\0';
- if (strlen(buf))
+ if (!ast_strlen_zero(buf))
adsi_process(scr, buf, script, lineno);
}
}
@@ -1540,7 +1541,7 @@ static int adsi_exec(struct ast_channel *chan, void *data)
{
int res=0;
struct localuser *u;
- if (!data || !strlen(data))
+ if (!data || ast_strlen_zero(data))
data = "asterisk.adsi";
LOCAL_USER_ADD(u);
if (!adsi_available(chan)) {