X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ztest%2Fread-marc.c;h=938804857d9d4cd280bc796fd77e11fa1cafaf23;hb=a92ea4f2be422ed5f52f0fc1c8b6416aebfe0c5a;hp=850b7060322fb541dbcf8368e9fb3f7c8fa29274;hpb=905df6869e5ad8ab9f34590cce771fe50c444473;p=yaz-moved-to-github.git diff --git a/ztest/read-marc.c b/ztest/read-marc.c index 850b706..9388048 100644 --- a/ztest/read-marc.c +++ b/ztest/read-marc.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 2002, Index Data. + * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: read-marc.c,v 1.5 2004-12-30 00:18:04 adam Exp $ + * $Id: read-marc.c,v 1.10 2007-05-06 20:12:22 adam Exp $ */ /* @@ -1602,8 +1602,8 @@ char *dummy_marc_record (int num, ODR odr) 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; @@ -1613,7 +1613,19 @@ char *dummy_xml_record (int num, ODR odr) 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 + */ +