/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
return 0;
}
p->len = len;
- p->buf = odr_malloc(o, len + 1);
- memcpy(p->buf, o->op->bp, len);
- p->buf[len] = '\0';
+ p->buf = odr_strdupn(o, o->op->bp, len);
o->op->bp += len;
return 1;
case ODR_ENCODE: