Fix diagnostic for MARC and present request out of range
[yaz-moved-to-github.git] / ztest / ztest.c
index 6b0c11f..fb9fd8d 100644 (file)
 #include <yaz/ill.h>
 #include <yaz/diagbib1.h>
 
+#include "ztest.h"
+
 static int log_level=0;
 static int log_level_set=0;
 
-Z_GenericRecord *dummy_grs_record (int num, ODR o);
-char *dummy_marc_record (int num, ODR odr);
-char *dummy_xml_record (int num, ODR odr);
-
 int ztest_search(void *handle, bend_search_rr *rr);
 int ztest_sort(void *handle, bend_sort_rr *rr);
 int ztest_present(void *handle, bend_present_rr *rr);
@@ -524,6 +522,7 @@ int ztest_fetch(void *handle, bend_fetch_rr *r)
         if (!cp)
         {
             r->errcode = YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE;
+            return 0;
         }
         else
         {