summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2002-01-22 01:12:39 (GMT)
committerwolfsuit <wolfsuit>2002-01-22 01:12:39 (GMT)
commitd58ab8b77be18950aadcf67d1b2f99278c1c70e3 (patch)
tree4fcc89aece13341f3c973796e7523096d9feda41
parent4f853bbd710d186ca988e6fb8ea678ef360c90f1 (diff)
downloadtk-d58ab8b77be18950aadcf67d1b2f99278c1c70e3.zip
tk-d58ab8b77be18950aadcf67d1b2f99278c1c70e3.tar.gz
tk-d58ab8b77be18950aadcf67d1b2f99278c1c70e3.tar.bz2
Fixed a bug in the Tk_GetFirstTextLayout when the input layout was for a
zero length string.
-rw-r--r--generic/tkFont.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c
index e8746dc..9d7e9ec 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.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: tkFont.c,v 1.12.2.1 2001/10/15 09:22:00 wolfsuit Exp $
+ * RCS: @(#) $Id: tkFont.c,v 1.12.2.2 2002/01/22 01:12:39 wolfsuit Exp $
*/
#include "tkPort.h"
@@ -3697,10 +3697,10 @@ Tk_GetFirstTextLayout(
int numDisplayChars;
layoutPtr = (TextLayout *)layout;
- if (layoutPtr==NULL) {
- return 0;
- }
- if (layoutPtr->numChunks==0) {
+ if ((layoutPtr==NULL)
+ || (layoutPtr->numChunks==0)
+ || (layoutPtr->chunks->numDisplayChars <= 0)) {
+ dst[0] = '\0';
return 0;
}
chunkPtr = layoutPtr->chunks;