projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow empty ODR (NMEM=0) for odr_oiddup and odr_getoidbystr.
[yaz-moved-to-github.git]
/
src
/
srw.c
diff --git
a/src/srw.c
b/src/srw.c
index
2663d97
..
9bce1b7
100644
(file)
--- a/
src/srw.c
+++ b/
src/srw.c
@@
-1,8
+1,8
@@
/*
/*
- * Copyright (c) 2002-2003, Index Data.
+ * Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
* 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.13 2004-01-05 14:46:52 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"))