aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_setcidname.c
diff options
context:
space:
mode:
authorcitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-09 07:51:44 +0000
committercitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-09 07:51:44 +0000
commit9bd61aa747cedeb161b46ca536312d8e569bfbf5 (patch)
treee02913e8cd2ec7f6236ac862e98d11dc9fd199ce /apps/app_setcidname.c
parent7bfd090538d068ea86150b0a7a27d5b2bda1df39 (diff)
More ast_strlen_zero changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2930 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_setcidname.c')
-rwxr-xr-xapps/app_setcidname.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/app_setcidname.c b/apps/app_setcidname.c
index d59044295..089d35f2f 100755
--- a/apps/app_setcidname.c
+++ b/apps/app_setcidname.c
@@ -20,6 +20,7 @@
#include <asterisk/translate.h>
#include <asterisk/image.h>
#include <asterisk/callerid.h>
+#include <asterisk/utils.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
@@ -63,17 +64,17 @@ static int setcallerid_exec(struct ast_channel *chan, void *data)
strncpy(oldcid, chan->callerid, sizeof(oldcid) - 1);
ast_callerid_parse(oldcid, &n, &l);
n = tmp;
- if (strlen(n)) {
- if (l && strlen(l))
+ if (!ast_strlen_zero(n)) {
+ if (l && !ast_strlen_zero(l))
snprintf(newcid, sizeof(newcid), "\"%s\" <%s>", n, l);
else
strncpy(newcid, tmp, sizeof(newcid) - 1);
- } else if (l && strlen(l)) {
+ } else if (l && !ast_strlen_zero(l)) {
strncpy(newcid, l, sizeof(newcid) - 1);
}
} else
strncpy(newcid, tmp, sizeof(newcid));
- ast_set_callerid(chan, strlen(newcid) ? newcid : NULL, anitoo);
+ ast_set_callerid(chan, !ast_strlen_zero(newcid) ? newcid : NULL, anitoo);
LOCAL_USER_REMOVE(u);
return res;
}