diff options
author | hobbs <hobbs> | 2000-02-01 11:41:43 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-02-01 11:41:43 (GMT) |
commit | d029a3f0572fd461b639eadd8d469ff99d01c4b5 (patch) | |
tree | 5aa30a90261ad40eb818a867dfa52d7455a6f388 /win/tkWinFont.c | |
parent | d9ef6f977a3ef1459bb388a5eb9d6ccdc1f8006b (diff) | |
download | tk-d029a3f0572fd461b639eadd8d469ff99d01c4b5.zip tk-d029a3f0572fd461b639eadd8d469ff99d01c4b5.tar.gz tk-d029a3f0572fd461b639eadd8d469ff99d01c4b5.tar.bz2 |
* win/Makefile.in (install-*): reduced verbosity of install
* win/tkWinPixmap.c (XGetGeometry): added support for windows in
XGetGeometry [Bug: 4069]
* win/tkWinFont.c (GetScreenFont): fixed possible mem overrun with
long font names [Bug: 4108]
* win/tkWinDialog.c: added EnableWindow calls to dialogs to
correct for possible loss of control in parent Tk toplevel
[Bug: 1212 et al]
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r-- | win/tkWinFont.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 74c9739..b00be43 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.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: tkWinFont.c,v 1.6 1999/12/16 21:59:35 hobbs Exp $ + * RCS: @(#) $Id: tkWinFont.c,v 1.7 2000/02/01 11:41:44 hobbs Exp $ */ #include "tkWinInt.h" @@ -1953,7 +1953,14 @@ GetScreenFont( Tcl_UtfToExternalDString(systemEncoding, faceName, -1, &ds); - if (platformId == VER_PLATFORM_WIN32_NT) { + /* + * We can only store up to LF_FACESIZE characters + */ + if (Tcl_DStringLength(&ds) >= LF_FACESIZE) { + Tcl_DStringSetLength(&ds, LF_FACESIZE); + } + + if (platformId == VER_PLATFORM_WIN32_NT) { Tcl_UniChar *src, *dst; src = (Tcl_UniChar *) Tcl_DStringValue(&ds); dst = (Tcl_UniChar *) lf.lfFaceName; |