Use g_strlcpy() instead of g_snprintf(dest, strlen(dest), "%s", src)

Fixes a SIGABRT at startup on OpenBSD, for some reason deep in the glib/libc
stack the va_list arg p is lost.. g_strlcpy() is equivalent here, and even faster.
This commit is contained in:
Landry Breuil
2014-11-29 11:48:38 +01:00
parent 92675eba53
commit 59ed589b26

View File

@@ -146,7 +146,7 @@ pretty_cmdline (gchar *cmdline, gchar *comm)
gchar *p = g_strstr_len (text, -1, comm);
if (p != NULL)
{
g_snprintf (text, g_utf8_strlen (text, -1), "%s", p);
g_strlcpy (text, p, g_utf8_strlen (text, -1));
}
}
}