summaryrefslogtreecommitdiffstats
path: root/generic/tkColor.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-09 22:41:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-09 22:41:52 (GMT)
commit06417a5bc8b38bc5b977583729e211b49107d727 (patch)
treea3c9e96e0beff9f5a6e9822510b654d0bb85d03b /generic/tkColor.c
parenta29e078d5ae9a283ef7404ccbbc548aa10bf8247 (diff)
downloadtk-06417a5bc8b38bc5b977583729e211b49107d727.zip
tk-06417a5bc8b38bc5b977583729e211b49107d727.tar.gz
tk-06417a5bc8b38bc5b977583729e211b49107d727.tar.bz2
Apply [Bug 2911570]'s patch to make color value hashing work on 64-bit.
Diffstat (limited to 'generic/tkColor.c')
-rw-r--r--generic/tkColor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tkColor.c b/generic/tkColor.c
index ccd46e7..2035ec4 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkColor.c,v 1.21 2009/11/21 17:24:42 dkf Exp $
+ * RCS: @(#) $Id: tkColor.c,v 1.22 2009/12/09 22:41:52 dkf Exp $
*/
#include "tkInt.h"
@@ -301,8 +301,11 @@ Tk_GetColorByValue(
/*
* First, check to see if there's already a mapping for this color name.
+ * Must clear the structure first; it's not tightly packed on 64-bit
+ * systems. [Bug 2911570]
*/
+ memset(&valueKey, 0, sizeof(ValueKey));
valueKey.red = colorPtr->red;
valueKey.green = colorPtr->green;
valueKey.blue = colorPtr->blue;