diff options
author | Robert Mader <robert.mader@posteo.de> | 2020-03-16 16:53:18 +0100 |
---|---|---|
committer | Robert Mader <robert.mader@posteo.de> | 2020-03-16 16:53:33 +0100 |
commit | 5343ec3345b69777388462fc8f0740bad3800a21 (patch) | |
tree | 8331676c5af33efe7b0998a12e766418032f2223 /gtk/gtkimcontextwayland.c | |
parent | c6cc02637ebe9bd55e545d6e909e24592453d669 (diff) | |
download | gtk+-5343ec3345b69777388462fc8f0740bad3800a21.tar.gz |
imcontextwayland: Honour len argument in gtk_im_context_wayland_set_surrounding
Clients may pass not `NULL`-terminated strings as the function takes a
`len` argument. Use that argument.
Diffstat (limited to 'gtk/gtkimcontextwayland.c')
-rw-r--r-- | gtk/gtkimcontextwayland.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c index 393f9b91c6..2462f7201f 100644 --- a/gtk/gtkimcontextwayland.c +++ b/gtk/gtkimcontextwayland.c @@ -860,7 +860,7 @@ gtk_im_context_wayland_set_surrounding (GtkIMContext *context, context_wayland = GTK_IM_CONTEXT_WAYLAND (context); g_free (context_wayland->surrounding.text); - context_wayland->surrounding.text = g_strdup (text); + context_wayland->surrounding.text = g_strndup (text, len); context_wayland->surrounding.cursor_idx = cursor_index; /* Anchor is not exposed via the set_surrounding interface, emulating. */ context_wayland->surrounding.anchor_idx = cursor_index; |