Module: Mesa
Branch: 12.0
Commit: 7757de1ebfb4855a8c91d96be8c41d71c50a02ff
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7757de1ebfb4855a8c91d96be8c41d71c50a02ff

Author: Emil Velikov <[email protected]>
Date:   Thu Sep  1 10:36:44 2016 +0100

glx/glvnd: list the strcmp arguments in correct order

Currently, due to the inverse order, strcmp will produce negative result
when the needle is towards the start of the haystack. Thus on the next
iteration(s) we'll end up further towards the end and eventually fail to
locate the entry.

Cc: "12.0" <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
(cherry picked from commit 62b224d428e04760dc96afb93873d67683337f88)

---

 src/glx/glxglvnd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glx/glxglvnd.c b/src/glx/glxglvnd.c
index 962eda8..098304d 100644
--- a/src/glx/glxglvnd.c
+++ b/src/glx/glxglvnd.c
@@ -24,8 +24,8 @@ static unsigned FindGLXFunction(const GLubyte *name)
 
     while (first <= last) {
         int middle = (first + last) / 2;
-        int comp = strcmp((const char *) name,
-                          __glXDispatchTableStrings[middle]);
+        int comp = strcmp(__glXDispatchTableStrings[middle],
+                          (const char *) name);
 
         if (comp < 0)
             first = middle + 1;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to