Bug fix: multiple databases weren't specified correctly.
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 28 Jul 1995 10:51:34 +0000 (10:51 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 28 Jul 1995 10:51:34 +0000 (10:51 +0000)
zlayer-yaz/zaccess.c

index 8d44091..ad64506 100644 (file)
  * Z39.50 API for the Email gateway - YAZ version
  *
  * $Log: zaccess.c,v $
- * Revision 1.3  1995/07/20 08:18:15  adam
+ * Revision 1.4  1995/07/28 10:51:34  adam
+ * Bug fix: multiple databases weren't specified correctly.
+ *
+ * Revision 1.3  1995/07/20  08:18:15  adam
  * Bug fix: Multiple databases are separated by commas and NOT by space.
  *
  * Revision 1.2  1995/07/05  11:08:33  adam
@@ -483,12 +486,13 @@ const struct zass_searchent *zass_search(ZASS a, struct ccl_rpn_node *query,
            more = 1;
        else
            more = 0;
-       *p = '\0';
        if (p - databases)
        {
            req->databaseNames[req->num_databaseNames] = odr_malloc(a->encode,
                (p - databases) + 1);
-           strcpy(req->databaseNames[req->num_databaseNames++], databases);
+           memcpy(req->databaseNames[req->num_databaseNames], databases, 
+                   p-databases);
+           req->databaseNames[req->num_databaseNames++][p-databases] = '\0';
        }
        databases = p + more;
     }