From: Adam Dickmeiss Date: Mon, 5 Jan 2004 14:05:56 +0000 (+0000) Subject: Fix bug in diagnostics decoding X-Git-Tag: YAZ.2.0.9.3~8 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=67f0b922040d236afc88b8d247acca84e5fa0d73;p=yaz-moved-to-github.git Fix bug in diagnostics decoding --- 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"))