]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
bug fixes
authorewt <ewt>
Mon, 12 Jul 1999 18:41:22 +0000 (18:41 +0000)
committerewt <ewt>
Mon, 12 Jul 1999 18:41:22 +0000 (18:41 +0000)
checkboxtree.c

index 159ae5ca9a4de22f5eb9e3c00b000e1bb9c2ca2f..b874c8dd77ea6c06ace7808fbce6ec125737151c 100644 (file)
@@ -99,7 +99,7 @@ int newtCheckboxTreeAddItem(newtComponent co,
 
     va_end(argList);
 
-    indexes = alloca(sizeof(*indexes) * numIndexes);
+    indexes = alloca(sizeof(*indexes) * (numIndexes + 1));
     va_start(argList, index);
     numIndexes = 0;
     i = index;
@@ -160,9 +160,13 @@ int newtCheckboxTreeAddArray(newtComponent co,
     int i, index, numIndexes;
     struct CheckboxTree * ct = co->data;
 
+    printf("here\n");
+
     numIndexes = 0;
     while (indexes[numIndexes] != NEWT_ARG_LAST) numIndexes++;
 
+    printf("there\n");
+
     if (!ct->itemlist) {
        if (numIndexes > 1) return -1;
 
@@ -206,6 +210,7 @@ int newtCheckboxTreeAddArray(newtComponent co,
            item->next = malloc(sizeof(*curList->prev));
            item->next->prev = item;
            item = item->next;
+           item->next = NULL;
        } else { 
            newNode = malloc(sizeof(*newNode));
            newNode->prev = item->prev;