aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-16 02:23:05 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-16 02:23:05 +0100
commit9624e8114408b96ac96675191ae2e34b0e403ee1 (patch)
treeb970b8a3246f73b374e0294b7787352721a5753c
parentfa474603ccaa1a50d258b82ee51e2bc9275ba8b9 (diff)
downloadslcl-9624e8114408b96ac96675191ae2e34b0e403ee1.tar.gz
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.
-rw-r--r--main.c11
1 files 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);