From 5bc4c0663576fd99bb06068e6dfd624690865c89 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 25 Oct 2026 19:42:27 +0100 Subject: Be stricter about const char*, Wwrite-strings will warn in the future and we don't want to try to overwrite string literals --- ot_config.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ot_config.c') diff --git a/ot_config.c b/ot_config.c index 43c07c5..e9666f9 100644 --- a/ot_config.c +++ b/ot_config.c @@ -22,10 +22,10 @@ #include "ot_stats.h" #include "trackerlogic.h" -char *g_redirecturl; -char *g_serverdir; -char *g_serveruser; -char *g_statefile; +const char *g_redirecturl; +const char *g_serverdir; +const char *g_serveruser; +const char *g_statefile; #define OT_LISTEN_INHERIT (-1) @@ -122,13 +122,13 @@ static int listen_scan_options(char *p, int *shared, int *workers) { } -char *set_config_option(char **option, char *value) { +static const char *set_config_option(const char **option, char *value) { #ifdef _DEBUG fprintf(stderr, "Setting config option: %s\n", value); #endif while (isspace(*value)) ++value; - free(*option); + free((char *)*option); return *option = strdup(value); } -- cgit v1.3