Fix clang compiler errors
authorPetr Štetiar <ynezz@true.cz>
Sun, 11 Oct 2020 09:04:05 +0000 (11:04 +0200)
committerPetr Štetiar <ynezz@true.cz>
Tue, 27 Oct 2020 22:03:04 +0000 (23:03 +0100)
Fixes following errors as reported by clang compilers:

 cgi-io/src/main.c:723:12: error: unused variable 'post' [-Werror,-Wunused-variable]
         autochar *post = postdecode(fields, 4);
                  ^
 cgi-io/src/main.c:814:12: error: unused variable 'post' [-Werror,-Wunused-variable]
         autochar *post = postdecode(fields, 1);
                  ^
 cgi-io/src/main.c:996:12: error: unused variable 'post' [-Werror,-Wunused-variable]
         autochar *post = postdecode(fields, 4);

Signed-off-by: Petr Štetiar <ynezz@true.cz>
main.c

diff --git a/main.c b/main.c
index 64f474f9283d5943506d81ae87c76533edabf54e..53c672836294df7f97074ef4492dd48030dcd056 100644 (file)
--- a/main.c
+++ b/main.c
@@ -721,6 +721,7 @@ main_download(int argc, char **argv)
        int rfd;
 
        autochar *post = postdecode(fields, 4);
+       (void) post;
 
        if (!fields[1] || !session_access(fields[1], "cgi-io", "download", "read"))
                return failure(403, 0, "Download permission denied");
@@ -812,6 +813,7 @@ main_backup(int argc, char **argv)
        char *fields[] = { "sessionid", NULL };
 
        autochar *post = postdecode(fields, 1);
+       (void) post;
 
        if (!fields[1] || !session_access(fields[1], "cgi-io", "backup", "read"))
                return failure(403, 0, "Backup permission denied");
@@ -999,6 +1001,7 @@ main_exec(int argc, char **argv)
        pid_t pid;
 
        autochar *post = postdecode(fields, 4);
+       (void) post;
 
        if (!fields[1] || !session_access(fields[1], "cgi-io", "exec", "read"))
                return failure(403, 0, "Exec permission denied");