[zaptel-commits] mattf: branch 1.2 r1638 - /branches/1.2/zaptel.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Nov 22 16:32:02 MST 2006


Author: mattf
Date: Wed Nov 22 17:32:01 2006
New Revision: 1638

URL: http://svn.digium.com/view/zaptel?view=rev&rev=1638
Log:
Update for #8403

Modified:
    branches/1.2/zaptel.c

Modified: branches/1.2/zaptel.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/zaptel.c?view=diff&rev=1638&r1=1637&r2=1638
==============================================================================
--- branches/1.2/zaptel.c (original)
+++ branches/1.2/zaptel.c Wed Nov 22 17:32:01 2006
@@ -576,19 +576,21 @@
 				}
 				len += sprintf(page + len, "\n");
 			}
-			if ( len <= off ) /* If everything printed so far is before beginning of request */
-			{
+			if (len <= off) { /* If everything printed so far is before beginning of request */
 				off -= len;
 				len = 0;
 			}
-		}
-	}
-	if ( len <= off ) /* If everything printed so far is before beginning of request */
-	{
+			if (len > off+count) /* stop if we've already generated enough */
+				break;
+		}
+	}
+	if (len <= off) { /* If everything printed so far is before beginning of request */
 		off -= len;
 		len = 0;
 	}
 	*start = page + off;
+	len -= off;     /* un-count any remaining offset */
+	if (len > count) len = count;   /* don't return bytes not asked for */
 	return len;
 }
 #endif



More information about the zaptel-commits mailing list