xprops: Cut off UTF-8 strings at n_items characters

There can be junk after here on some X servers.
This commit is contained in:
Jasper St. Pierre 2015-06-23 11:52:47 -07:00
parent 5d360a9bce
commit 734402e14d

View File

@ -438,8 +438,7 @@ utf8_string_from_results (GetPropertyResults *results,
return FALSE;
}
*str_p = (char*) results->prop;
results->prop = NULL;
*str_p = g_strndup ((char *) results->prop, results->n_items);
return TRUE;
}