diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkEntry.c | 5 | ||||
-rw-r--r-- | generic/tkSelect.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkEntry.c | 5 |
3 files changed, 7 insertions, 5 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 5681e47..a66cf18 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1927,7 +1927,7 @@ EntryComputeGeometry( if (entryPtr->showChar != NULL) { Tcl_UniChar ch; - char buf[TCL_UTF_MAX]; + char buf[4]; int size; /* @@ -1945,7 +1945,8 @@ EntryComputeGeometry( entryPtr->displayString = p; for (i = entryPtr->numChars; --i >= 0; ) { - p += Tcl_UniCharToUtf(ch, p); + memcpy(p, buf, size); + p += size; } *p = '\0'; } diff --git a/generic/tkSelect.c b/generic/tkSelect.c index ab9018a..74b3964 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -26,7 +26,7 @@ typedef struct { int charOffset; /* The offset of the next char to retrieve. */ int byteOffset; /* The expected byte offset of the next * chunk. */ - char buffer[TCL_UTF_MAX]; /* A buffer to hold part of a UTF character + char buffer[4]; /* A buffer to hold part of a UTF character * that is split across chunks. */ char command[1]; /* Command to invoke. Actual space is * allocated as large as necessary. This must diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index f395649..d80e1fd 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -283,14 +283,15 @@ static char *EntryDisplayString(const char *showChar, int numChars) char *displayString, *p; int size; Tcl_UniChar ch; - char buf[TCL_UTF_MAX]; + char buf[4]; Tcl_UtfToUniChar(showChar, &ch); size = Tcl_UniCharToUtf(ch, buf); p = displayString = ckalloc(numChars * size + 1); while (numChars--) { - p += Tcl_UniCharToUtf(ch, p); + memcpy(p, buf, size); + p += size; } *p = '\0'; |