mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-14 19:38:10 +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:
@@ -20,6 +20,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#ifndef _H_LG_COMMON_STRINGUTILS
|
||||
#define _H_LG_COMMON_STRINGUTILS
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// vsprintf but with buffer allocation
|
||||
int valloc_sprintf(char ** str, const char * format, va_list ap)
|
||||
__attribute__ ((format (printf, 2, 0)));
|
||||
@@ -28,4 +30,7 @@ int valloc_sprintf(char ** str, const char * format, va_list ap)
|
||||
int alloc_sprintf(char ** str, const char * format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
// Find value in a list separated by delimiter.
|
||||
bool str_containsValue(const char * list, char delimiter, const char * value);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user