From 9624e8114408b96ac96675191ae2e34b0e403ee1 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 16 Mar 2023 02:23:05 +0100 Subject: main.c: Fix undefined value for cur As otherwise reported by clang 14.0.0: main.c:679:14: warning: variable 'cur' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized] else if (available && quota_current(a, username, &cur)) This was a minor issue after all, as pq was not used unless available were set. --- main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index face845..42bc2f0 100644 --- a/main.c +++ b/main.c @@ -682,11 +682,12 @@ static int getnode(const struct http_payload *const p, goto end; } - const struct page_quota pq = - { - .cur = cur, - .max = max - }, *const ppq = available ? &pq : NULL; + const struct page_quota *const ppq = available ? + &(const struct page_quota) + { + .cur = cur, + .max = max + } : NULL; ret = page_resource(r, dir.str, root.str, d.str, ppq); -- cgit v1.2.3