diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-21 22:10:02 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-21 22:10:02 +0000 |
commit | 4c6eeea773a3f37589b6822bace06ad3ae3d8df5 (patch) | |
tree | 51c54c5d22e891a14201d8ed17f465f94e6e41b3 /main/say.c | |
parent | dd2a163fdebf3b833243ef088969e8ed2c82ea83 (diff) |
Fix a crash when saying certain numbers in Chinese
This commit fixes a crash that was occurring when attempting to
say a number between 10000 and 100000 due to dividing by 0.
This also removes some places where a "zero" is spoken when it
should not be.
(closes issue #14291)
Reported by: dant
Patches:
say.c-14291.diff uploaded by dant (license 670)
Tested by: dant
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169794 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/say.c')
-rw-r--r-- | main/say.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/main/say.c b/main/say.c index 943ccaf11..46b7d058e 100644 --- a/main/say.c +++ b/main/say.c @@ -2308,11 +2308,6 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char num -= ((num / 100) * 100); } else if (num < 10000){ snprintf(buf, 10, "%d", num); - if (last_length - strlen(buf) > 1 && last_length != 0 && last_length % strlen(buf) > 0) { - last_length = strlen(buf); - playz++; - continue; - } snprintf(fn, sizeof(fn), "digits/%d", (num / 1000)); playt++; snprintf(buf, 10, "%d", num); @@ -2323,9 +2318,6 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char res = ast_say_number_full_tw(chan, num / 10000, ints, language, audiofd, ctrlfd); if (res) return res; - if (((num / 10000) % (num/100000)) == 0) - playz++; - snprintf(buf, 10, "%d", num); ast_log(LOG_DEBUG, "Number '%d' %d %d\n", num, (int)strlen(buf), last_length); num -= ((num / 10000) * 10000); |