projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
20ce1ea
)
Fix bug in diagnostics decoding
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 5 Jan 2004 14:05:56 +0000
(14:05 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 5 Jan 2004 14:05:56 +0000
(14:05 +0000)
src/srw.c
patch
|
blob
|
history
diff --git
a/src/srw.c
b/src/srw.c
index
2663d97
..
e3f4d72
100644
(file)
--- a/
src/srw.c
+++ b/
src/srw.c
@@
-2,7
+2,7
@@
* Copyright (c) 2002-2003, Index Data.
* See the file LICENSE for details.
*
* 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 <yaz/srw.h>
*/
#include <yaz/srw.h>
@@
-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));
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"))
{
if (ptr->type == XML_ELEMENT_NODE &&
!strcmp(ptr->name, "diagnostic"))