X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fprop.c;h=bce0426b0fe373bf3a06828bcf2649a94535d32f;hb=4eb80a81cf99fe6fc14521a3503bb4fd482fc1da;hp=27941ac32c3e19b6d0fadc31c290f7051d3d8bcb;hpb=d4b20aef313238e65d176822d44ee259b72e4f95;p=chaz%2Fopenbox diff --git a/openbox/prop.c b/openbox/prop.c index 27941ac3..bce0426b 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -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; } @@ -352,11 +352,11 @@ void prop_set_string_utf8(Window win, Atom prop, char *val) void prop_set_strings_utf8(Window win, Atom prop, char **strs) { GString *str; - guint i; + char **s; str = g_string_sized_new(0); - for (i = 0; strs[i]; ++i) { - str = g_string_append(str, strs[i]); + for (s = strs; *s; ++s) { + str = g_string_append(str, *s); str = g_string_append_c(str, '\0'); } XChangeProperty(ob_display, win, prop, prop_atoms.utf8, 8,