From a6ef0993e8a5b2ec38bc9548174958fde70538a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 11 Oct 2011 22:45:14 -0400 Subject: [PATCH] x11: Truncate property string to property length --- compositor/xserver-launcher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compositor/xserver-launcher.c b/compositor/xserver-launcher.c index 47c60600..0cfbdd6f 100644 --- a/compositor/xserver-launcher.c +++ b/compositor/xserver-launcher.c @@ -170,10 +170,11 @@ wlsc_wm_get_properties(struct wlsc_wm *wm, xcb_window_t window) value = xcb_get_property_value(reply); fprintf(stderr, "property %s, type %d, format %d, " - "length %d (value_len %d), value \"%s\"\n", + "length %d (value_len %d), value \"%.*s\"\n", get_atom_name(wm->conn, props[i].atom), reply->type, reply->format, - xcb_get_property_value_length(reply), reply->value_len, + xcb_get_property_value_length(reply), + reply->value_len, reply->value_len, reply->type ? (char *) value : "(nil)"); free(reply);