Use g_utf8_strlen(text, -1) to check for text length, not sizeof(text) which is the size of a pointer and always > 3

This commit is contained in:
Landry Breuil
2014-11-29 11:41:58 +01:00
parent 18311141d0
commit 92675eba53

View File

@@ -138,7 +138,7 @@ static gchar *
pretty_cmdline (gchar *cmdline, gchar *comm)
{
gchar *text = g_strchomp (g_strdelimit (g_strdup (cmdline), "\n\r", ' '));
if (!full_cmdline && sizeof (text) > 3)
if (!full_cmdline && g_utf8_strlen (text, -1) > 3)
{
/* Shorten full path to commands and wine applications */
if (text[0] == '/' || (g_ascii_isupper (text[0]) && text[1] == ':' && text[2] == '\\'))