Fix all warnings when compiling with -Wall -W -pedantic.
[tinc] / src / protocol.c
index c7dd8fb..1ca24e5 100644 (file)
@@ -76,7 +76,7 @@ bool send_request(connection_t *c, const char *format, ...) {
        request[sizeof(request) - 1] = 0;
        va_end(args);
 
-       if(len < 0 || len > sizeof(request) - 1) {
+       if(len < 0 || (size_t)len > sizeof(request) - 1) {
                logger(DEBUG_ALWAYS, LOG_ERR, "Output buffer overflow while sending request to %s (%s)",
                       c->name, c->hostname);
                return false;
@@ -175,6 +175,7 @@ static void free_past_request(past_request_t *r) {
 static timeout_t past_request_timeout;
 
 static void age_past_requests(void *data) {
+       (void)data;
        int left = 0, deleted = 0;
 
        for splay_each(past_request_t, p, past_request_tree) {
@@ -196,7 +197,7 @@ static void age_past_requests(void *data) {
 }
 
 bool seen_request(const char *request) {
-       past_request_t *new, p = {NULL};
+       past_request_t *new, p = {0};
 
        p.request = request;