diff options
author | Jonathan Krebs <[email protected]> | 2019-06-14 15:24:13 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-09-12 15:51:14 +0200 |
commit | 89b3e063eb5c1693f4e0ba4bababb3e05a448354 (patch) | |
tree | 1e962575d4367c329f591fe607f93c98af8ed956 | |
parent | bd0cf4893b267762cd35fb68f900b4be9de81138 (diff) | |
download | mate-applets-89b3e063eb5c1693f4e0ba4bababb3e05a448354.tar.bz2 mate-applets-89b3e063eb5c1693f4e0ba4bababb3e05a448354.tar.xz |
treat output as utf8 when limiting width.
fixes #374
-rw-r--r-- | command/command.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/command/command.c b/command/command.c index f62f2325..fe791f4c 100644 --- a/command/command.c +++ b/command/command.c @@ -23,9 +23,9 @@ */ #include <config.h> -#include <string.h> #include <glib.h> +#include <gmodule.h> #include <glib/gi18n.h> #include <gio/gio.h> #include <gtk/gtk.h> @@ -348,9 +348,9 @@ process_command_output (CommandApplet *command_applet, gchar *output) g_strstrip (output); /* check output length */ - if (strlen (output) > command_applet->width) + if (g_utf8_strlen (output, strlen(output)) > command_applet->width) { - output[command_applet->width] = '\0'; + *g_utf8_offset_to_pointer(output, command_applet->width) = '\0'; } gtk_label_set_text (command_applet->label, output); |