mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] egl: use new util_hasGLExt helper to check extensions
We previously used strstr, which can be prone to false positives when the name of one extension is a substring of another extension. This commit creates the helper function util_hasGLExt, which asserts that the substring found in extension list is bounded by either spaces or the beginning/end of the string.
This commit is contained in:
@@ -21,9 +21,11 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "main.h"
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/stringutils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
|
||||
@@ -207,3 +209,8 @@ void util_rotatePoint(struct DoublePoint *point)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool util_hasGLExt(const char * exts, const char * ext)
|
||||
{
|
||||
return str_containsValue(exts, ' ', ext);
|
||||
}
|
||||
|
Reference in New Issue
Block a user