X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fpquery.c;h=c787b5835f9eff2744f441faaa32291eea67f077;hp=d4b995886e88596772ab4b693d0b40bd63e7d4c3;hb=cabcc223cd47503763e7c42969e3be30c58276af;hpb=f720562471a064dba92a465d999aa833e59d69b1 diff --git a/src/pquery.c b/src/pquery.c index d4b9958..c787b58 100644 --- a/src/pquery.c +++ b/src/pquery.c @@ -313,8 +313,11 @@ Z_Term *z_Term_create(ODR o, int term_type, const char *buf, size_t len) Odr_oct *term_octet = (Odr_oct *)odr_malloc(o, sizeof(*term_octet)); term_octet->buf = (unsigned char *)odr_malloc(o, 1 + len); memcpy(term_octet->buf, buf, len); - term_octet->size = term_octet->len = len; - term_octet->buf[term_octet->size] = 0; /* null terminate */ + term_octet->len = len; +#if OCT_SIZE + term_octet->size = len; +#endif + term_octet->buf[term_octet->len] = 0; /* null terminate */ switch (term_type) {