shared/platform.h: use weston_check_egl_extension over strstr
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 4 Jul 2016 14:34:19 +0000 (15:34 +0100)
committerDaniel Stone <daniels@collabora.com>
Fri, 22 Jul 2016 14:28:45 +0000 (15:28 +0100)
The later can give false positives.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
shared/platform.h

index 77c8259..e0ed55b 100644 (file)
@@ -88,9 +88,9 @@ weston_platform_get_egl_proc_address(const char *address)
 {
        const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
 
-       if (extensions
-           && (strstr(extensions, "EGL_EXT_platform_wayland")
-               || strstr(extensions, "EGL_KHR_platform_wayland"))) {
+       if (extensions &&
+           (weston_check_egl_extension(extensions, "EGL_EXT_platform_wayland") ||
+            weston_check_egl_extension(extensions, "EGL_KHR_platform_wayland"))) {
                return (void *) eglGetProcAddress(address);
        }