From 2ab2a84c1473e3e7af561423ca1b766126fc72fa Mon Sep 17 00:00:00 2001 From: Yann Pomarede Date: Tue, 28 Feb 2017 12:47:03 +0100 Subject: [PATCH] change function die, warn, inform and debug change funcions die, warn, inform and debug argument from `char*` to `const char*` to prevent a warning in C== --- common.c | 8 ++++---- common.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common.c b/common.c index 53d7715e..0776407d 100644 --- a/common.c +++ b/common.c @@ -91,7 +91,7 @@ int get_requested_connection_state_to_output() { return requested_connection_sta void set_requested_connection_state_to_output(int v) { requested_connection_state_to_output = v; } -void die(char *format, ...) { +void die(const char *format, ...) { char s[1024]; s[0] = 0; va_list args; @@ -103,7 +103,7 @@ void die(char *format, ...) { exit(1); } -void warn(char *format, ...) { +void warn(const char *format, ...) { char s[1024]; s[0] = 0; va_list args; @@ -113,7 +113,7 @@ void warn(char *format, ...) { daemon_log(LOG_WARNING, "%s", s); } -void debug(int level, char *format, ...) { +void debug(int level, const char *format, ...) { if (level > debuglev) return; char s[1024]; @@ -125,7 +125,7 @@ void debug(int level, char *format, ...) { daemon_log(LOG_DEBUG, "%s", s); } -void inform(char *format, ...) { +void inform(const char *format, ...) { char s[1024]; s[0] = 0; va_list args; diff --git a/common.h b/common.h index d3beeb0d..19f0cb94 100644 --- a/common.h +++ b/common.h @@ -172,10 +172,10 @@ uint64_t ranarray64u(); int64_t ranarray64i(); extern int debuglev; -void die(char *format, ...); -void warn(char *format, ...); -void inform(char *format, ...); -void debug(int level, char *format, ...); +void die(const char *format, ...); +void warn(const char *format, ...); +void inform(const char *format, ...); +void debug(int level, const char *format, ...); uint8_t *base64_dec(char *input, int *outlen); char *base64_enc(uint8_t *input, int length); -- 2.47.2