From: notting Date: Thu, 5 Aug 1999 20:50:24 +0000 (+0000) Subject: fix so checkboxtrees can have 0 or 1 entries. X-Git-Tag: r0-50~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccfdaf09e90382ec8e7dd2e1de0095232c9a439b;p=thirdparty%2Fnewt.git fix so checkboxtrees can have 0 or 1 entries. --- diff --git a/checkboxtree.c b/checkboxtree.c index c698bcb..535266e 100644 --- a/checkboxtree.c +++ b/checkboxtree.c @@ -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,