diff options
author | Corentin Noël <corentin.noel@collabora.com> | 2023-08-11 19:18:49 +0200 |
---|---|---|
committer | Corentin Noël <corentin.noel@collabora.com> | 2023-08-11 19:19:42 +0200 |
commit | f0355541b9b851edd0278ef804631698feff39fd (patch) | |
tree | fb59162eab1bc43743c3fab02e97a4062fc3e812 | |
parent | dc5502d3de903f962359e4d71be897a22cef739a (diff) |
util: Fix log level lookup
There was currently no real iteration of the log_levels_table.
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1202>
-rw-r--r-- | src/virgl_util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/virgl_util.c b/src/virgl_util.c index 4ca40d6..a74ab4b 100644 --- a/src/virgl_util.c +++ b/src/virgl_util.c @@ -173,12 +173,15 @@ void virgl_default_logger(UNUSED enum virgl_log_level_flags log_level, if (!virgl_log_level_initialized) { const char* log_level_env = getenv("VIRGL_LOG_LEVEL"); if (log_level_env != NULL && log_level_env[0] != '\0') { - const struct log_levels_lut *lut = log_levels_table; + int log_index = 0; + const struct log_levels_lut *lut = &log_levels_table[0]; while (lut->name) { if (!strcmp(lut->name, log_level_env)) { virgl_log_level = lut->log_level; break; } + + lut = &log_levels_table[++log_index]; } if (!lut->name) |