Silence “variable length array bound evaluates to non-positive value 0”

This commit is contained in:
Daniel Eklöf 2021-08-26 13:27:29 +02:00
parent b8dd247111
commit 1079bca3eb
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 13 additions and 6 deletions

View file

@ -13,6 +13,8 @@
#include "i3-ipc.h"
#include "i3-common.h"
#define max(x, y) ((x) > (y) ? (x) : (y))
struct input {
bool exists;
char *identifier;
@ -65,7 +67,8 @@ content(struct module *mod)
mtx_lock(&mod->lock);
struct exposable *particles[m->num_existing_inputs];
struct exposable *particles[max(m->num_existing_inputs, 1)];
for (size_t i = 0, j = 0; i < m->num_inputs; i++) {
const struct input *input = &m->inputs[i];