From 88f689c744618f268daa08469712f856725c6707 Mon Sep 17 00:00:00 2001 From: Pere Pujal i Carabantes Date: Sat, 1 Jan 2022 19:58:36 +0100 Subject: [PATCH] Uppercase fix for Turkish. Make use of full allocated space of ustr. --- src/tuxpaint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 3eba2be24..24ba73ef8 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -18376,7 +18376,7 @@ static char *uppercase(const char *restrict const str) dest[i] = towupper(dest[i]); } while (dest[i++]); - wcstombs(ustr, dest, n); /* at most n bytes written */ + wcstombs(ustr, dest, n * 2); /* at most n * 2 bytes written */ #ifdef DEBUG printf(" ORIGINAL: %s\n" "UPPERCASE: %s\n\n", str, ustr);