xutil: get_text_property_from_reply return strdup
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
e298353583
commit
e56ef78d92
|
@ -31,7 +31,7 @@
|
||||||
#include "common/array.h"
|
#include "common/array.h"
|
||||||
#include "common/atoms.h"
|
#include "common/atoms.h"
|
||||||
|
|
||||||
static inline const char *
|
static inline char *
|
||||||
xutil_get_text_property_from_reply(xcb_get_property_reply_t *reply)
|
xutil_get_text_property_from_reply(xcb_get_property_reply_t *reply)
|
||||||
{
|
{
|
||||||
if(reply
|
if(reply
|
||||||
|
@ -40,7 +40,7 @@ xutil_get_text_property_from_reply(xcb_get_property_reply_t *reply)
|
||||||
|| reply->type == COMPOUND_TEXT)
|
|| reply->type == COMPOUND_TEXT)
|
||||||
&& reply->format == 8
|
&& reply->format == 8
|
||||||
&& xcb_get_property_value_length(reply))
|
&& xcb_get_property_value_length(reply))
|
||||||
return xcb_get_property_value(reply);
|
return a_strndup(xcb_get_property_value(reply), xcb_get_property_value_length(reply));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue