diff options
author | Mark Spencer <markster@digium.com> | 2004-05-04 14:54:42 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-05-04 14:54:42 +0000 |
commit | a5ad1269ef42bd302fa053d95fc8584664b163ba (patch) | |
tree | a24abdff859a43193ef8ae0dec06210f3126adb9 /say.c | |
parent | 958668f00174ef231190431ff134f95d921e8c1f (diff) |
More strlen_zero checks (bug #1549)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'say.c')
-rwxr-xr-x | say.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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]; |