From 67f0b922040d236afc88b8d247acca84e5fa0d73 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 5 Jan 2004 14:05:56 +0000 Subject: [PATCH] Fix bug in diagnostics decoding --- src/srw.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/srw.c b/src/srw.c index 2663d97..e3f4d72 100644 --- a/src/srw.c +++ b/src/srw.c @@ -2,7 +2,7 @@ * Copyright (c) 2002-2003, Index Data. * See the file LICENSE for details. * - * $Id: srw.c,v 1.11 2004-01-05 09:34:42 adam Exp $ + * $Id: srw.c,v 1.12 2004-01-05 14:05:56 adam Exp $ */ #include @@ -279,7 +279,12 @@ static int yaz_srw_diagnostics(ODR o, xmlNodePtr pptr, Z_SRW_diagnostic **recs, if (!*num) return 1; *recs = odr_malloc(o, *num * sizeof(**recs)); - for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next, i++) + for (i = 0; i < *num; i++) + { + (*recs)[i].code = 0; + (*recs)[i].details = 0; + } + for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next) { if (ptr->type == XML_ELEMENT_NODE && !strcmp(ptr->name, "diagnostic")) -- 1.7.10.4