aboutsummaryrefslogtreecommitdiffstats
path: root/say.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 14:54:42 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-05-04 14:54:42 +0000
commit3d2252c81d824df7b13198547853215b38f9e81c (patch)
treea24abdff859a43193ef8ae0dec06210f3126adb9 /say.c
parent2a9c1292282f85c8957de69bca15e11b98c7d305 (diff)
More strlen_zero checks (bug #1549)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2887 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'say.c')
-rwxr-xr-xsay.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/say.c b/say.c
index 92dfcd19d..4867ef055 100755
--- a/say.c
+++ b/say.c
@@ -23,6 +23,7 @@
#include <asterisk/say.h>
#include <asterisk/lock.h>
#include <asterisk/localtime.h>
+#include <asterisk/utils.h>
#include "asterisk.h"
#include <stdio.h>
@@ -50,7 +51,7 @@ int ast_say_digit_str(struct ast_channel *chan, char *fn2, char *ints, char *lan
snprintf(fn, sizeof(fn), "digits/%c", fn2[num]);
}
}
- if(strlen(fn)){ /* if length == 0, then skip this digit as it is invalid */
+ if(!ast_strlen_zero(fn)){ /* if length == 0, then skip this digit as it is invalid */
res = ast_streamfile(chan, fn, lang);
if (!res)
res = ast_waitstream(chan, ints);
@@ -121,7 +122,7 @@ int ast_say_character_str(struct ast_channel *chan, char *fn2, char *ints, char
if ('A' <= ltr && ltr <= 'Z') ltr += 'a' - 'A'; /* file names are all lower-case */
snprintf(fn, sizeof(fn), "letters/%c", ltr);
}
- if(strlen(fn)){ /* if length == 0, then skip this digit as it is invalid */
+ if(!ast_strlen_zero(fn)) { /* if length == 0, then skip this digit as it is invalid */
res = ast_streamfile(chan, fn, lang);
if (!res)
res = ast_waitstream(chan, ints);
@@ -192,7 +193,7 @@ int ast_say_phonetic_str(struct ast_channel *chan, char *fn2, char *ints, char *
case ('%'):
play=0;
/* check if we have 2 chars after the % */
- if (strlen(fn2)>num+2)
+ if (strlen(fn2) > num+2)
{
hex[0]=fn2[num+1];
hex[1]=fn2[num+2];