aboutsummaryrefslogtreecommitdiffstats
path: root/callerid.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-26 18:54:24 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-26 18:54:24 +0000
commit1168964aa44ffe50af7f08aaae9fc1bbc90e7784 (patch)
treec0ffbb2fbd1dd819c7587a31da636ca6f4ae71c0 /callerid.c
parentdb653f9eb1553a706ec819af67d84e261df14a26 (diff)
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
Diffstat (limited to 'callerid.c')
-rwxr-xr-xcallerid.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/callerid.c b/callerid.c
index 192e9c7f1..875071cb8 100755
--- a/callerid.c
+++ b/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);
}