X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fxml_match.c;h=0a9019a144ebd31d9e769182b11eca26a86f91cb;hp=dd804db3b5d727f2848e000f2af146f8cee7e456;hb=ea0ffea1d02fe623b4da5b7b8aa972aa9f32f071;hpb=f720562471a064dba92a465d999aa833e59d69b1 diff --git a/src/xml_match.c b/src/xml_match.c index dd804db..0a9019a 100644 --- a/src/xml_match.c +++ b/src/xml_match.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ /** @@ -107,10 +107,7 @@ int yaz_match_xsd_XML_n2(xmlNodePtr ptr, const char *elem, ODR o, xmlBufferAddHead(buf, (const xmlChar *) "", -1); xmlBufferAdd(buf, (const xmlChar *) "", -1); } - *val = (char *) odr_malloc(o, buf->use + 1); - memcpy(*val, buf->content, buf->use); - (*val)[buf->use] = '\0'; - + *val = odr_strdupn(o, (const char *) buf->content, buf->use); if (len) *len = buf->use;