summaryrefslogtreecommitdiff
path: root/gdk/x11
diff options
context:
space:
mode:
Diffstat (limited to 'gdk/x11')
-rw-r--r--gdk/x11/gdkmain-x11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 936787fa0a..14ebfa4e91 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -3842,6 +3842,9 @@ _g_mbtowc (wchar_t *wstr, const char *str, size_t len)
wcs[0] = (wchar_t) NULL;
mbs[0] = '\0';
+ /* The last argument isn't a mistake. The X locale code trims
+ * the input string to the length of the output string!
+ */
len = _Xmbstowcs (wcs, str, (len<MB_CUR_MAX)? len:MB_CUR_MAX);
if (len < 1)
return len;