[asterisk-commits] murf: branch 1.2 r77942 - /branches/1.2/fskmodem.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 2 12:56:38 CDT 2007


Author: murf
Date: Thu Aug  2 12:56:37 2007
New Revision: 77942

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77942
Log:
This patch hopefully solves 10141; The user is running with it, and it doesn't appear to harm asterisk's operation, and may prevent a crash. I'll store it in 1.2, as we have shut down support on 1.2, but since I developed the patch before support finished, and it might affect 1.4 and trunk, I'm going ahead with it.

Modified:
    branches/1.2/fskmodem.c

Modified: branches/1.2/fskmodem.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/fskmodem.c?view=diff&rev=77942&r1=77941&r2=77942
==============================================================================
--- branches/1.2/fskmodem.c (original)
+++ branches/1.2/fskmodem.c Thu Aug  2 12:56:37 2007
@@ -185,6 +185,9 @@
 	int i,j,n1,r;
 	int samples=0;
 	int olen;
+	int beginlen=*len;
+	int beginlenx;
+	
 	switch(fskd->state) {
 		/* Pick up where we left off */
 	case STATE_SEARCH_STARTBIT2:
@@ -212,12 +215,13 @@
 beginning of a start bit in the TDD sceanario. It just looks for sufficient
 level to maybe, perhaps, guess, maybe that its maybe the beginning of
 a start bit, perhaps. This whole thing stinks! */
+		beginlenx=beginlen; /* just to avoid unused war warnings */
 		if (demodulador(fskd,&fskd->x1,GET_SAMPLE)) return(-1);
 		samples++;
 		for(;;)
 		   {
 search_startbit2:		   
-			if (!*len) {
+			if (*len <= 0) {
 				fskd->state = STATE_SEARCH_STARTBIT2;
 				return 0;
 			}
@@ -235,7 +239,7 @@
 			fskd->state = STATE_SEARCH_STARTBIT3;
 			return 0;
 		}
-		for(;i;i--) { if (demodulador(fskd,&fskd->x1,GET_SAMPLE)) return(-1); 
+		for(;i>0;i--) { if (demodulador(fskd,&fskd->x1,GET_SAMPLE)) return(-1); 
 #if 0
 			printf("x1 = %5.5f ", fskd->x1);
 #endif			




More information about the asterisk-commits mailing list