Added check to prevent retrieval of more than global_parameters.toget recs
authorSebastian Hammer <quinn@indexdata.com>
Sat, 6 Jan 2007 03:02:47 +0000 (03:02 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Sat, 6 Jan 2007 03:02:47 +0000 (03:02 +0000)
src/pazpar2.c

index cb6a384..fa2d51f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pazpar2.c,v 1.15 2007-01-05 20:33:05 adam Exp $ */;
+/* $Id: pazpar2.c,v 1.16 2007-01-06 03:02:47 quinn Exp $ */;
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -199,6 +199,8 @@ static void send_present(IOCHAN i)
     int start = cl->records + 1;
 
     toget = global_parameters.chunk;
+    if (toget > global_parameters.toget - cl->records)
+        toget = global_parameters.toget - cl->records;
     if (toget > cl->hits - cl->records)
        toget = cl->hits - cl->records;