From 17d4a5dd35e3e72a194ca295da98e62060a180a8 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 24 Sep 2014 10:50:54 +0200 Subject: [PATCH] monitor: fix clang warning - Declared variable-length array (VLA) has zero size --- alsactl/monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alsactl/monitor.c b/alsactl/monitor.c index 536176d..29379ad 100644 --- a/alsactl/monitor.c +++ b/alsactl/monitor.c @@ -91,7 +91,7 @@ int monitor(const char *name) snd_ctl_t *ctls[MAX_CARDS]; int ncards = 0; int show_cards; - int i, err; + int i, err = 0; if (!name) { int card = -1; @@ -117,7 +117,7 @@ int monitor(const char *name) show_cards = 0; } - for (;;) { + for (;ncards > 0;) { struct pollfd fds[ncards]; for (i = 0; i < ncards; i++)