diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2014-06-01 15:19:46 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2014-06-09 22:55:51 +0100 |
commit | c153b1f39b60f7a2ba59262b12b4597cbfbf36ca (patch) | |
tree | 9bcb293cd9cb551511d5ef6f7717590b47df8518 /src/egl | |
parent | 357a8b6f334da9e78d9cadebb8d729a0d1d38c3d (diff) | |
download | external_mesa3d-c153b1f39b60f7a2ba59262b12b4597cbfbf36ca.zip external_mesa3d-c153b1f39b60f7a2ba59262b12b4597cbfbf36ca.tar.gz external_mesa3d-c153b1f39b60f7a2ba59262b12b4597cbfbf36ca.tar.bz2 |
egl/dri2/x11: use standard strndup function
Using a custom version of the function brings no benefit.
Cc: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 874bcc4..548334e 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -481,21 +481,6 @@ dri2_x11_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate) #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) { @@ -565,14 +550,14 @@ 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); |