]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fix so checkboxtrees can have 0 or 1 entries.
authornotting <notting>
Thu, 5 Aug 1999 20:50:24 +0000 (20:50 +0000)
committernotting <notting>
Thu, 5 Aug 1999 20:50:24 +0000 (20:50 +0000)
checkboxtree.c

index c698bcbdcc866e56dfb57503e7e12bfe9585e7a0..535266e921b9840828ba2f65ab4f006314b0f363 100644 (file)
@@ -76,9 +76,10 @@ static void buildFlatList(newtComponent co) {
     if (ct->flatList) free(ct->flatList);
     ct->flatCount = countItems(ct->itemlist, COUNT_EXPOSED);
 
-    ct->flatList = malloc(sizeof(*ct->flatList) * ct->flatCount);
+    ct->flatList = malloc(sizeof(*ct->flatList) * (ct->flatCount+1));
     ct->flatCount = 0;
     doBuildFlatList(ct, ct->itemlist);;
+       ct->flatList[ct->flatCount] = NULL;
 }
 
 int newtCheckboxTreeAddItem(newtComponent co,