[Asterisk-code-review] say: Fix a bug where SayNumber in Polish tries to play incor... (asterisk[certified/11.6])

Joshua Colp asteriskteam at digium.com
Thu Jul 21 07:33:28 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: say: Fix a bug where SayNumber in Polish tries to play incorrect sound.
......................................................................


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

Change-Id: If91e16115badaf13255db36cfffc845df9dfe476
---
M main/say.c
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/main/say.c b/main/say.c
index 295d411..337c7b0 100644
--- a/main/say.c
+++ b/main/say.c
@@ -1901,17 +1901,17 @@
 	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 {

-- 
To view, visit https://gerrit.asterisk.org/3265
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If91e16115badaf13255db36cfffc845df9dfe476
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: certified/11.6
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list