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>
#include <string.h>
#include <strings.h>
#include "c11/threads.h"
+#include "util/macros.h"
#include "egllog.h"
"warning",
"info",
"debug",
- NULL
};
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;