From 0e1ac7200aeba08e2debbe83c951f1b47d1ef92e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sat, 1 Apr 2006 07:21:12 +0000 Subject: [PATCH] Fixed bug #558: present request out of range with presentChunk/step --- src/zoom-c.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/zoom-c.c b/src/zoom-c.c index 21d17c9..78c3948 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: zoom-c.c,v 1.66 2006-03-31 09:51:22 adam Exp $ + * $Id: zoom-c.c,v 1.67 2006-04-01 07:21:12 adam Exp $ */ /** * \file zoom-c.c @@ -1144,7 +1144,7 @@ static zoom_ret ZOOM_connection_send_init (ZOOM_connection c) ZOOM_options_get(c->options, "implementationName"), odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName)); - version = odr_strdup(c->odr_out, "$Revision: 1.66 $"); + version = odr_strdup(c->odr_out, "$Revision: 1.67 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; ireq->implementationVersion = odr_prepend(c->odr_out, @@ -2368,9 +2368,10 @@ static zoom_ret send_present(ZOOM_connection c) *req->resultSetStartPoint = resultset->start + 1; *req->numberOfRecordsRequested = resultset->step>0 ? resultset->step : resultset->count; + if (*req->numberOfRecordsRequested + resultset->start > resultset->size) + *req->numberOfRecordsRequested = resultset->size - resultset->start; assert (*req->numberOfRecordsRequested > 0); - if (syntax && *syntax) req->preferredRecordSyntax = yaz_str_to_z3950oid (c->odr_out, CLASS_RECSYN, syntax); -- 1.7.10.4