aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authorcitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-03 04:37:03 +0000
committercitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-03 04:37:03 +0000
commita290d4e49488c90b2b53bd95f6e5420f31c9cf4b (patch)
treeb286a27d16a90d58fda13eec8c1c35b90710f27c /app.c
parent987c82bd24bfb884114b1c5cf49c63bd3795a8e7 (diff)
Change strlen calls to ast_strlen_zero in voicemail checking stuff because it is called all the time
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2870 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rwxr-xr-xapp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/app.c b/app.c
index 4c4cfab8b..dcdd91ebf 100755
--- a/app.c
+++ b/app.c
@@ -27,6 +27,7 @@
#include <asterisk/dsp.h>
#include <asterisk/logger.h>
#include <asterisk/options.h>
+#include <asterisk/utils.h>
#include "asterisk.h"
#include "astconf.h"
@@ -153,14 +154,14 @@ int ast_app_has_voicemail(const char *mailbox)
char *context;
int ret;
/* If no mailbox, return immediately */
- if (!strlen(mailbox))
+ if (ast_strlen_zero(mailbox))
return 0;
if (strchr(mailbox, ',')) {
strncpy(tmp, mailbox, sizeof(tmp));
mb = tmp;
ret = 0;
while((cur = strsep(&mb, ","))) {
- if (strlen(cur)) {
+ if (!ast_strlen_zero(cur)) {
if (ast_app_has_voicemail(cur))
return 1;
}
@@ -202,7 +203,7 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
if (oldmsgs)
*oldmsgs = 0;
/* If no mailbox, return immediately */
- if (!strlen(mailbox))
+ if (ast_strlen_zero(mailbox))
return 0;
if (strchr(mailbox, ',')) {
int tmpnew, tmpold;
@@ -210,7 +211,7 @@ int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
mb = tmp;
ret = 0;
while((cur = strsep(&mb, ", "))) {
- if (strlen(cur)) {
+ if (!ast_strlen_zero(cur)) {
if (ast_app_messagecount(cur, newmsgs ? &tmpnew : NULL, oldmsgs ? &tmpold : NULL))
return -1;
else {