]> git.alsa-project.org Git - alsa-lib.git/commitdiff
error: use SND_LOG_LAST/SND_ILOG_LAST in log priority/interface bounds checks
authorJaroslav Kysela <perex@perex.cz>
Thu, 28 May 2026 10:04:46 +0000 (12:04 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 May 2026 10:11:14 +0000 (12:11 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/error.c

index ad874202dc7bbbe5faca8c5a324da0ebf2a04c3b..e721bdc0044b18b7cae42d486624f5792454c8ab 100644 (file)
@@ -124,7 +124,7 @@ static const char *snd_ilog_interface_names[SND_ILOG_LAST + 1] = {
  */
 const char *snd_lib_log_priority(int prio)
 {
-       if (prio >= 0 && prio <= SND_LOG_TRACE)
+       if (prio >= 0 && prio <= SND_LOG_LAST)
                return snd_log_prio_names[prio];
        return NULL;
 }
@@ -136,7 +136,7 @@ const char *snd_lib_log_priority(int prio)
  */
 const char *snd_lib_log_interface(int interface)
 {
-       if (interface >= 0 && interface <= SND_ILOG_TOPOLOGY)
+       if (interface >= 0 && interface <= SND_ILOG_LAST)
                return snd_ilog_interface_names[interface];
        return NULL;
 }