/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
/**
p->which = Z_External_octet;
if (!(p->u.octet_aligned = (Odr_oct *)odr_malloc(o, sizeof(Odr_oct))))
return 0;
- if (!(p->u.octet_aligned->buf = (unsigned char *)odr_malloc(o, len)))
+ if (!(p->u.octet_aligned->buf = (char *)odr_malloc(o, len)))
return 0;
- p->u.octet_aligned->len = p->u.octet_aligned->size = len;
+ p->u.octet_aligned->len = len;
+#if OCT_SIZE
+ p->u.octet_aligned->size = len;
+#endif
memcpy(p->u.octet_aligned->buf, buf, len);
return p;