No unsigned char's in public API (except for iconv)
[yaz-moved-to-github.git] / src / pquery.c
index d4b9958..f2c39e8 100644 (file)
@@ -311,10 +311,13 @@ Z_Term *z_Term_create(ODR o, int term_type, const char *buf, size_t len)
 {
     Z_Term *term = (Z_Term *)odr_malloc(o, sizeof(*term));
     Odr_oct *term_octet = (Odr_oct *)odr_malloc(o, sizeof(*term_octet));
-    term_octet->buf = (unsigned char *)odr_malloc(o, 1 + len);
+    term_octet->buf = (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)
     {