Do not build for Ubuntu raring, quantal (obsolete)
[idzebra-moved-to-github.git] / index / zebrasrv.c
index 8c50469..2560f4e 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the Zebra server.
-   Copyright (C) 2004-2013 Index Data
+   Copyright (C) Index Data
 
 Zebra is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -212,7 +212,7 @@ static void search_terms(ZebraHandle zh, bend_search_rr *r)
     sr->num = no_terms;
     sr->elements = odr_malloc(r->stream, sr->num *
                                sizeof(*sr->elements));
-    for (i = 0; i<no_terms; i++)
+    for (i = 0; i < no_terms; i++)
     {
        Z_SearchInfoReport_s *se;
         Z_Term *term;
@@ -246,10 +246,11 @@ static void search_terms(ZebraHandle zh, bend_search_rr *r)
             break;
         case Z_Term_general:
             term->which = Z_Term_general;
-            term->u.general = odr_malloc(r->stream, sizeof(*term->u.general));
-            term->u.general->size = term->u.general->len = len;
-            term->u.general->buf = odr_malloc(r->stream, len);
-            memcpy(term->u.general->buf, outbuf, len);
+            term->u.general = odr_create_Odr_oct(r->stream,
+#if YAZ_VERSIONL < 0x50000
+                                                 (unsigned char *)
+#endif
+                                                 outbuf, len);
             break;
         default:
             term->which = Z_Term_general;