dont get a null at the end of the data, so use strndup
This commit is contained in:
parent
cb6840788b
commit
693c88ca35
1 changed files with 1 additions and 1 deletions
|
@ -303,7 +303,7 @@ gboolean prop_get_string_utf8(Window win, Atom prop, char **ret)
|
|||
guint num;
|
||||
|
||||
if (get_all(win, prop, prop_atoms.utf8, 8, (guchar**)&raw, &num)) {
|
||||
*ret = g_strdup(raw); /* grab the first string from the list */
|
||||
*ret = g_strndup(raw, num); /* grab the first string from the list */
|
||||
g_free(raw);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue