egl: drop unneeded sentinel from level_strings[]
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 4 May 2017 18:34:43 +0000 (19:34 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 8 May 2017 14:34:09 +0000 (15:34 +0100)
The array is local so we already know its size.

v2: Correct loop condition (Bartosz)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/egl/main/egllog.c

index 6f0c0cda6c3e8cbe370902debcd064c2f42a482b..7af381830ed14a8913ffdf0584a6efeba6df4e6b 100644 (file)
@@ -41,6 +41,7 @@
 #include <string.h>
 #include <strings.h>
 #include "c11/threads.h"
+#include "util/macros.h"
 
 #include "egllog.h"
 
@@ -82,7 +83,6 @@ static const char *level_strings[] = {
    "warning",
    "info",
    "debug",
-   NULL
 };
 
 
@@ -129,7 +129,7 @@ _eglInitLogger(void)
 
    log_env = getenv("EGL_LOG_LEVEL");
    if (log_env) {
-      for (i = 0; level_strings[i]; i++) {
+      for (i = 0; i < ARRAY_SIZE(level_strings); i++) {
          if (strcasecmp(log_env, level_strings[i]) == 0) {
             level = i;
             break;