From 62dc7b6fe547a4f1a5cca669a177f3ea668c8186 Mon Sep 17 00:00:00 2001 From: thorkill Date: Mon, 29 Jun 2015 00:42:31 +0200 Subject: [PATCH] Type mismatch and debug_t is always >= 0 - Proper function definitions --- src/control.c | 5 ++--- src/control.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/control.c b/src/control.c index 98eae804..bf84a069 100644 --- a/src/control.c +++ b/src/control.c @@ -78,12 +78,11 @@ bool control_h(connection_t *c, const char *request) { return control_ok(c, REQ_PURGE); case REQ_SET_DEBUG: { - int new_level; + debug_t new_level; if(sscanf(request, "%*d %*d %d", &new_level) != 1) return false; send_request(c, "%d %d %d", CONTROL, REQ_SET_DEBUG, debug_level); - if(new_level >= 0) - debug_level = new_level; + debug_level = new_level; return true; } diff --git a/src/control.h b/src/control.h index ce8145a3..8609fc86 100644 --- a/src/control.h +++ b/src/control.h @@ -20,8 +20,8 @@ #ifndef __TINC_CONTROL_H__ #define __TINC_CONTROL_H__ -extern bool init_control(); -extern void exit_control(); +extern bool init_control(void); +extern void exit_control(void); extern char controlcookie[]; #endif