#endif
}
-static char *
-dri2_x11_strndup(const char *s, int length)
-{
- char *d;
-
- d = malloc(length + 1);
- if (d == NULL)
- return NULL;
-
- memcpy(d, s, length);
- d[length] = '\0';
-
- return d;
-}
-
static EGLBoolean
dri2_x11_connect(struct dri2_egl_display *dri2_dpy)
{
driver_name = xcb_dri2_connect_driver_name (connect);
dri2_dpy->driver_name =
- dri2_x11_strndup(driver_name,
- xcb_dri2_connect_driver_name_length(connect));
+ strndup(driver_name,
+ xcb_dri2_connect_driver_name_length(connect));
device_name = xcb_dri2_connect_device_name (connect);
dri2_dpy->device_name =
- dri2_x11_strndup(device_name,
- xcb_dri2_connect_device_name_length(connect));
+ strndup(device_name,
+ xcb_dri2_connect_device_name_length(connect));
if (dri2_dpy->device_name == NULL || dri2_dpy->driver_name == NULL) {
free(dri2_dpy->device_name);