Use oid_class rather than int for OID class.
[yaz-moved-to-github.git] / src / marcdisp.c
index 33ec6f9..0dd8aaa 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: marcdisp.c,v 1.49 2007-03-20 21:37:32 adam Exp $
+ * $Id: marcdisp.c,v 1.51 2007-09-20 17:22:45 adam Exp $
  */
 
 /**
@@ -137,7 +137,8 @@ static int marc_exec_leader(const char *leader_spec, char *leader,
 
 static struct yaz_marc_node *yaz_marc_add_node(yaz_marc_t mt)
 {
-    struct yaz_marc_node *n = nmem_malloc(mt->nmem, sizeof(*n));
+    struct yaz_marc_node *n = (struct yaz_marc_node *)
+        nmem_malloc(mt->nmem, sizeof(*n));
     n->next = 0;
     *mt->nodes_pp = n;
     mt->nodes_pp = &n->next;
@@ -256,7 +257,8 @@ void yaz_marc_add_subfield(yaz_marc_t mt,
 
     if (mt->subfield_pp)
     {
-        struct yaz_marc_subfield *n = nmem_malloc(mt->nmem, sizeof(*n));
+        struct yaz_marc_subfield *n = (struct yaz_marc_subfield *)
+            nmem_malloc(mt->nmem, sizeof(*n));
         n->code_data = nmem_strdupn(mt->nmem, code_data, code_data_len);
         n->next = 0;
         /* mark subfield_pp to point to this one, so we append here next */
@@ -597,7 +599,9 @@ static int yaz_marc_write_marcxml_ns1(yaz_marc_t mt, WRBUF wr,
             wrbuf_iconv_write_cdata(wr, mt->iconv_cd, n->u.controlfield.tag,
                                     strlen(n->u.controlfield.tag));
             wrbuf_iconv_puts(wr, mt->iconv_cd, "\">");
-            wrbuf_iconv_puts(wr, mt->iconv_cd, n->u.controlfield.data);
+            wrbuf_iconv_write_cdata(wr, mt->iconv_cd,
+                                    n->u.controlfield.data,
+                                    strlen(n->u.controlfield.data));
 
             marc_iconv_reset(mt, wr);
             wrbuf_iconv_puts(wr, mt->iconv_cd, "</controlfield>");