]> the.earth.li Git - onak.git/blobdiff - cgi/hashquery.c
Mark unused function parameters
[onak.git] / cgi / hashquery.c
index 5c056a2d3298ab3bb37769cbcd92eb1c0faae7f4..84efe97e514ae7b89d254b46e626fd9a416e8ac4 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdint.h>
 #include <unistd.h>
 
+#include "build-config.h"
 #include "charfuncs.h"
 #include "cleanup.h"
 #include "keydb.h"
@@ -40,9 +41,9 @@ void doerror(char *error)
        exit(EXIT_FAILURE);
 }
 
-int main(int argc, char *argv[])
+int main(__unused int argc, __unused char *argv[])
 {
-       char *request_method;
+       char *request_method, *env;
        int count, found, i;
        uint8_t **hashes;
        struct buffer_ctx cgipostbuf;
@@ -57,7 +58,8 @@ int main(int argc, char *argv[])
                doerror("hashquery must be a HTTP POST request.\n");
        }
 
-       if (!(cgipostbuf.size = atoi(getenv("CONTENT_LENGTH")))) {
+       env = getenv("CONTENT_LENGTH");
+       if ((env == NULL) || !(cgipostbuf.size = atoi(env))) {
                doerror("Must provide a content length.\n");
        }