Commit 917dc2d4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB: avoid strndup() for debug messages

parent b195d6ef
...@@ -72,12 +72,8 @@ static xcb_connection_t *Connect (vlc_object_t *obj, const char *display) ...@@ -72,12 +72,8 @@ static xcb_connection_t *Connect (vlc_object_t *obj, const char *display)
const xcb_setup_t *setup = xcb_get_setup (conn); const xcb_setup_t *setup = xcb_get_setup (conn);
msg_Dbg (obj, "connected to X%"PRIu16".%"PRIu16" server", msg_Dbg (obj, "connected to X%"PRIu16".%"PRIu16" server",
setup->protocol_major_version, setup->protocol_minor_version); setup->protocol_major_version, setup->protocol_minor_version);
char *vendor = strndup (xcb_setup_vendor (setup), setup->vendor_len); msg_Dbg (obj, " vendor : %.*s", (int)setup->vendor_len,
if (vendor) xcb_setup_vendor (setup));
{
msg_Dbg (obj, " vendor : %s", vendor);
free (vendor);
}
msg_Dbg (obj, " version: %"PRIu32, setup->release_number); msg_Dbg (obj, " version: %"PRIu32, setup->release_number);
return conn; return conn;
} }
......
...@@ -428,7 +428,6 @@ static int Open (vlc_object_t *obj) ...@@ -428,7 +428,6 @@ static int Open (vlc_object_t *obj)
xcb_xv_adaptor_info_next (&it)) xcb_xv_adaptor_info_next (&it))
{ {
const xcb_xv_adaptor_info_t *a = it.data; const xcb_xv_adaptor_info_t *a = it.data;
char *name;
adaptor_current++; adaptor_current++;
if (adaptor_selected != -1 && adaptor_selected != adaptor_current) if (adaptor_selected != -1 && adaptor_selected != adaptor_current)
...@@ -466,12 +465,8 @@ static int Open (vlc_object_t *obj) ...@@ -466,12 +465,8 @@ static int Open (vlc_object_t *obj)
grabbed_port: grabbed_port:
/* Found port - initialize selected format */ /* Found port - initialize selected format */
name = strndup (xcb_xv_adaptor_info_name (a), a->name_size); msg_Dbg (vd, "using adaptor %.*s", (int)a->name_size,
if (name != NULL) xcb_xv_adaptor_info_name (a));
{
msg_Dbg (vd, "using adaptor %s", name);
free (name);
}
msg_Dbg (vd, "using port %"PRIu32, p_sys->port); msg_Dbg (vd, "using port %"PRIu32, p_sys->port);
msg_Dbg (vd, "using image format 0x%"PRIx32, p_sys->id); msg_Dbg (vd, "using image format 0x%"PRIx32, p_sys->id);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment