[PATCH weston 4/9] shared/platform.h: use weston_check_extension over strstr

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 4 14:34:19 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

The later can give false positives.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 shared/platform.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shared/platform.h b/shared/platform.h
index 98849f0..b8be6bf 100644
--- a/shared/platform.h
+++ b/shared/platform.h
@@ -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_extension(extensions, "EGL_EXT_platform_wayland") ||
+	     weston_check_extension(extensions, "EGL_KHR_platform_wayland"))) {
 		return (void *) eglGetProcAddress(address);
 	}
 
-- 
2.8.2



More information about the wayland-devel mailing list