summaryrefslogtreecommitdiff
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2010-02-05 11:11:07 +0800
committerChia-I Wu <olvaffe@gmail.com>2010-02-05 11:44:49 +0800
commit7e7c1ba40b6e10b7d38490e7f3252dbebb3a3a72 (patch)
tree90e603662bfe0a6bbb0358f64bbb215b70fe3dba /src/egl/drivers
parent8d411c9a127beb75b2af8b9135b971afa53202c7 (diff)
egl_dri2: Fix a snprintf warning.
The subtraction between two pointers has type unsigned int (only on x86-64?), while the format string expects an int.
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index d5fabbf4d8..84dd958490 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -496,13 +496,16 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp,
dri2_dpy->driver = NULL;
end = search_paths + strlen(search_paths);
for (p = search_paths; p < end && dri2_dpy->driver == NULL; p = next + 1) {
+ int path_len;
+
next = strchr(p, ':');
if (next == NULL)
next = end;
+ path_len = next - p;
snprintf(path, sizeof path,
dri_driver_format,
- next - p, p,
+ path_len, p,
xcb_dri2_connect_driver_name_length (connect),
xcb_dri2_connect_driver_name (connect));