Warn for bad base address in MARC parser
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 17 Dec 2003 12:28:07 +0000 (12:28 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 17 Dec 2003 12:28:07 +0000 (12:28 +0000)
src/marcdisp.c

index 7dbb7ea..1266d25 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2003, Index Data
  * See the file LICENSE for details.
  *
  * Copyright (c) 1995-2003, Index Data
  * See the file LICENSE for details.
  *
- * $Id: marcdisp.c,v 1.2 2003-12-11 00:37:22 adam Exp $
+ * $Id: marcdisp.c,v 1.3 2003-12-17 12:28:07 adam Exp $
  */
 
 #if HAVE_CONFIG_H
  */
 
 #if HAVE_CONFIG_H
@@ -212,6 +212,11 @@ int yaz_marc_decode_wrbuf (yaz_marc_t mt, const char *buf, int bsize, WRBUF wr)
         if (entry_p >= record_length)
             return -1;
     }
         if (entry_p >= record_length)
             return -1;
     }
+    if (mt->debug && base_address != entry_p+1)
+    {
+       wrbuf_printf (wr,"  <!-- base address not at end of directory "
+                     "base=%d end=%d -->\n", base_address, entry_p+1);
+    }
     base_address = entry_p+1;
 
     if (mt->xml == YAZ_MARC_ISO2709)
     base_address = entry_p+1;
 
     if (mt->xml == YAZ_MARC_ISO2709)