From a5ebdfbdd3845ef01e1c2e8d19daae12fc2f036e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 29 Sep 2009 12:58:40 +0200 Subject: [PATCH] ZOOM_record_get returns 0 for bad MARC. ZOOM_record_get returns 0 pointer if a MARC record can not be decoded - unless type desired is "raw". This will prevent type "xml" from returning ISO2709 .. Which obviously can not be XML parsed. --- src/zoom-c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zoom-c.c b/src/zoom-c.c index d0f5042..e05de20 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -1971,6 +1971,9 @@ static const char *return_record(ZOOM_record rec, int *len, charset); if (ret_buf) return ret_buf; + /* bad ISO2709. Return fail unless raw (ISO2709) is wanted */ + if (marctype != YAZ_MARC_ISO2709) + return 0; } return return_string_record(rec, len, (const char *) r->u.octet_aligned->buf, -- 1.7.10.4