From: Emil Velikov Date: Thu, 1 Sep 2016 09:36:44 +0000 (+0100) Subject: glx/glvnd: list the strcmp arguments in correct order X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62b224d428e04760dc96afb93873d67683337f88;p=mesa.git 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" Signed-off-by: Emil Velikov Reviewed-by: Eric Engestrom --- diff --git a/src/glx/glxglvnd.c b/src/glx/glxglvnd.c index 962eda8bb5b..098304d5574 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;