summaryrefslogtreecommitdiffstats
path: root/win/tkWinFont.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-02-01 11:41:42 (GMT)
committerhobbs <hobbs@noemail.net>2000-02-01 11:41:42 (GMT)
commit42692518238da97d086d6e862f6e5211cdbd9a91 (patch)
tree5aa30a90261ad40eb818a867dfa52d7455a6f388 /win/tkWinFont.c
parent4826b8d28a8a78d636465f5de50c82173324bf88 (diff)
downloadtk-42692518238da97d086d6e862f6e5211cdbd9a91.zip
tk-42692518238da97d086d6e862f6e5211cdbd9a91.tar.gz
tk-42692518238da97d086d6e862f6e5211cdbd9a91.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] FossilOrigin-Name: 97a60a4857c1e41eedeefeffdb0f432156ccce64
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r--win/tkWinFont.c11
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;