From 98091b2f1e28cf7373d7db1fa74dad2e3604b61b Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Fri, 21 Mar 2008 02:02:30 +0000 Subject: [PATCH] Copy properly a window text property --- common/xutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/xutil.c b/common/xutil.c index e1cd7cd5b..fd1ca2ea7 100644 --- a/common/xutil.c +++ b/common/xutil.c @@ -54,12 +54,12 @@ xgettextprop(xcb_connection_t *conn, xcb_window_t w, xcb_atom_t atom, prop_val = (char *) xcb_get_property_value(name); if(name->type == STRING) - a_strncpy(text, textlen, prop_val, textlen - 1); + a_strncpy(text, name->value_len + 1, prop_val, textlen - 1); /* TODO: XCB doesn't provide a XmbTextPropertyToTextList(), check * whether this code is correct (locales) */ else if(name->format == 8) - a_strncpy(text, textlen, prop_val, textlen - 1); + a_strncpy(text, name->value_len + 1, prop_val, textlen - 1); text[textlen - 1] = '\0'; p_delete(&name);