X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fodr_mem.c;h=71a10e147137cd99ae935afdea8920bf53d30f7c;hp=690477db393f1af6d7bd0fdec0b18b8c4ce6a1ca;hb=b696a59e5609651787b64b953b581a3ceb263f14;hpb=4db187fbff08310195d08260817d7aa63f1fa4bc diff --git a/src/odr_mem.c b/src/odr_mem.c index 690477d..71a10e1 100644 --- a/src/odr_mem.c +++ b/src/odr_mem.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. */ /** @@ -65,9 +65,7 @@ size_t odr_total(ODR o) Odr_oct *odr_create_Odr_oct(ODR o, const char *buf, int sz) { Odr_oct *p = (Odr_oct *) odr_malloc(o, sizeof(Odr_oct)); - p->buf = (char *) odr_malloc(o, sz + 1); - memcpy(p->buf, buf, sz); - p->buf[sz] = '\0'; + p->buf = odr_strdupn(o, buf, sz); p->len = sz; return p; }