Avoid buffer[length] construct in yaz-ztest
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 10 Aug 2010 13:46:38 +0000 (15:46 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 10 Aug 2010 13:46:38 +0000 (15:46 +0200)
ztest/ztest.c

index 6397831..50872a3 100644 (file)
@@ -232,7 +232,7 @@ static void addterms(ODR odr, Z_FacetField *facet_field, const char *facet_name)
     int index;
     int freq = 100;
     int length = strlen(facet_name) + 10;
-    char key[length];
+    char *key = odr_malloc(odr, length);
     key[0] = '\0';
     for (index = 0; index < facet_field->num_terms; index++) {
         Z_Term *term;