[asterisk-commits] file: branch 1.8 r411243 - /branches/1.8/main/say.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 26 17:43:34 CDT 2014


Author: file
Date: Wed Mar 26 17:43:25 2014
New Revision: 411243

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411243
Log:
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/

Modified:
    branches/1.8/main/say.c

Modified: branches/1.8/main/say.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/say.c?view=diff&rev=411243&r1=411242&r2=411243
==============================================================================
--- branches/1.8/main/say.c (original)
+++ branches/1.8/main/say.c Wed Mar 26 17:43:25 2014
@@ -1893,28 +1893,28 @@
 	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 {
 			char buf[10];
 			char *b = buf;
-			b = pl_append(b, odm->dziesiatki[m100 / 10]);  
-			b = pl_append(b, odm->separator_dziesiatek);  
-			pl_append(b, odm->cyfry2[m100 % 10]); 
+			b = pl_append(b, odm->dziesiatki[m100 / 10]);
+			b = pl_append(b, odm->separator_dziesiatek);
+			pl_append(b, odm->cyfry2[m100 % 10]);
 			pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, buf);
 		}
-	} 
+	}
 
 	if (rzad > 0) {
 		pl_odtworz_plik(chan, language, audiofd, ctrlfd, ints, pl_rzad_na_tekst(odm, i, rzad));




More information about the asterisk-commits mailing list