summaryrefslogtreecommitdiffstats
path: root/generic/tkConfig.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2005-10-10 21:22:15 (GMT)
committerhobbs <hobbs@noemail.net>2005-10-10 21:22:15 (GMT)
commit7277cea9722a29aaf5d94f05f0def1f7ab1c0113 (patch)
treef9c7aacbafc9f8428fcc3c907121eae25cfd1f56 /generic/tkConfig.c
parent90c8d603451b6fbfd189fe0e4d84c469e036b15a (diff)
downloadtk-7277cea9722a29aaf5d94f05f0def1f7ab1c0113.zip
tk-7277cea9722a29aaf5d94f05f0def1f7ab1c0113.tar.gz
tk-7277cea9722a29aaf5d94f05f0def1f7ab1c0113.tar.bz2
* generic/tkConfig.c (Tk_DeleteOptionTable, Tk_CreateOptionTable):
properly alloc/delete one more option. [Bug 1319720] (melbardis) FossilOrigin-Name: 502574153fd2fbf4e1f58b129c7ca0c73c6be6cb
Diffstat (limited to 'generic/tkConfig.c')
-rw-r--r--generic/tkConfig.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 124c452..da39158 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkConfig.c,v 1.18.2.1 2005/08/11 12:17:09 dkf Exp $
+ * RCS: @(#) $Id: tkConfig.c,v 1.18.2.2 2005/10/10 21:22:17 hobbs Exp $
*/
/*
@@ -226,7 +226,7 @@ Tk_CreateOptionTable(interp, templatePtr)
numOptions++;
}
tablePtr = (OptionTable *) (ckalloc(sizeof(OptionTable)
- + ((numOptions - 1) * sizeof(Option))));
+ + (numOptions * sizeof(Option))));
tablePtr->refCount = 1;
tablePtr->hashEntryPtr = hashEntryPtr;
tablePtr->nextPtr = NULL;
@@ -354,7 +354,7 @@ Tk_DeleteOptionTable(optionTable)
Tk_DeleteOptionTable((Tk_OptionTable) tablePtr->nextPtr);
}
- for (count = tablePtr->numOptions - 1, optionPtr = tablePtr->options;
+ for (count = tablePtr->numOptions, optionPtr = tablePtr->options;
count > 0; count--, optionPtr++) {
if (optionPtr->defaultPtr != NULL) {
Tcl_DecrRefCount(optionPtr->defaultPtr);