/*
- * Copyright (C) 1995-2005, Index Data ApS
+ * Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: read-marc.c,v 1.6 2005-01-15 19:47:16 adam Exp $
+ * $Id: read-marc.c,v 1.10 2007-05-06 20:12:22 adam Exp $
*/
/*
char *dummy_xml_record (int num, ODR odr)
{
yaz_marc_t mt = yaz_marc_create();
- char *result;
- int rlen;
+ const char *result;
+ size_t rlen;
char *rec = dummy_marc_record (num, odr);
int len;
yaz_marc_xml(mt, YAZ_MARC_MARCXML);
len = yaz_marc_decode_buf (mt, rec, -1, &result, &rlen);
if (len > 1)
- rec = (char *) odr_strdup(odr, result);
+ {
+ rec = (char *) odr_malloc(odr, rlen+1);
+ memcpy(rec, result, rlen);
+ rec[rlen] = '\0';
+ }
yaz_marc_destroy(mt);
return rec;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+