From: Joshua Colp Date: Wed, 26 Mar 2014 22:44:11 +0000 (+0000) Subject: say: Fix a bug where SayNumber in Polish tries to play incorrect sound. X-Git-Tag: 11.9.0-rc1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=818f476893484e96037d02d4e5660e60e6cbe559;p=thirdparty%2Fasterisk.git say: Fix a bug where SayNumber in Polish tries to play incorrect sound. This change fixes a bug where calling SayNumber with a number divisible by 100 using the Polish language would cause the code to attempt to play a sound file with an empty name. (closes issue ASTERISK-23509) Reported by: zvision Review: https://reviewboard.asterisk.org/r/3378/ ........ Merged revisions 411243 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@411244 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/say.c b/main/say.c index b91af1b912..0738d01da2 100644 --- a/main/say.c +++ b/main/say.c @@ -1901,17 +1901,17 @@ static void powiedz(struct ast_channel *chan, const char *language, int audiofd, if (i100>0) pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, odm->setki[i100]); - if ( m100 > 0 && m100 <=9 ) { - if (m1000>0) + if (m100 > 0 && m100 <= 9) { + if (m1000 > 0) pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, odm->cyfry2[m100]); else pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, odm->cyfry[m100]); - } else if (m100 % 10 == 0) { + } else if (m100 % 10 == 0 && m100 != 0) { pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, odm->dziesiatki[m100 / 10]); - } else if (m100 <= 19 ) { + } else if (m100 > 10 && m100 <= 19) { pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, odm->nastki[m100 % 10]); - } else if (m100 != 0) { - if (odm->separator_dziesiatek[0]==' ') { + } else if (m100 > 20) { + if (odm->separator_dziesiatek[0] == ' ') { pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, odm->dziesiatki[m100 / 10]); pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, odm->cyfry2[m100 % 10]); } else {