From ad1f9204a2f00c7c703f202e9c692e9620ee1f56 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 7 Dec 2016 15:12:15 +0000 Subject: [PATCH] Avoid C99 declaration after statement The rest of the library is C89-only, so we should keep it that way. --- src/dispatch_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index ba6fca3..4f58be2 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -347,11 +347,12 @@ epoxy_conservative_gl_version(void) bool epoxy_extension_in_string(const char *extension_list, const char *ext) { - if (!extension_list) - return false; const char *ptr = extension_list; int len = strlen(ext); + if (extension_list == NULL || *extension_list == '\0') + return false; + /* Make sure that don't just find an extension with our name as a prefix. */ while (true) { ptr = strstr(ptr, ext);