diff --git a/src/config/opttypes.c b/src/config/opttypes.c index cd0e012f2..aa8ece402 100644 --- a/src/config/opttypes.c +++ b/src/config/opttypes.c @@ -374,7 +374,7 @@ cp_eq(struct option *opt, const char *str) static void cp_wr(struct option *o, struct string *s) { - char *mime_name = get_cp_config_name(o->value.number); + const char *mime_name = get_cp_config_name(o->value.number); add_optstring_to_string(s, mime_name, strlen(mime_name)); } diff --git a/src/dialogs/options.c b/src/dialogs/options.c index 292a8865b..5177a5793 100644 --- a/src/dialogs/options.c +++ b/src/dialogs/options.c @@ -71,7 +71,7 @@ charset_list(struct terminal *term, void *xxx, void *ses_) sel = items; items++; add_to_menu(&mi, name, NULL, ACT_MAIN_NONE, - display_codepage, get_cp_config_name(i), 0); + display_codepage, (void *)get_cp_config_name(i), 0); } do_menu_selected(term, mi, ses, sel, 0); diff --git a/src/intl/charsets.c b/src/intl/charsets.c index 8530f807d..0388133b2 100644 --- a/src/intl/charsets.c +++ b/src/intl/charsets.c @@ -1634,7 +1634,7 @@ get_cp_name(int cp_index) /* Get the codepage's name for saving to a configuration file. These * names can be converted back to indexes, even in future versions of * ELinks. */ -char * +const char * get_cp_config_name(int cp_index) { if (cp_index < 0) return "none"; diff --git a/src/intl/charsets.h b/src/intl/charsets.h index 0885749be..64aaf7fc0 100644 --- a/src/intl/charsets.h +++ b/src/intl/charsets.h @@ -126,7 +126,7 @@ char *convert_string(struct conv_table *convert_table, int get_cp_index(const char *); const char *get_cp_name(int); -char *get_cp_config_name(int); +const char *get_cp_config_name(int); char *get_cp_mime_name(int); const uint16_t *get_cp_highhalf(const char *); diff --git a/src/scripting/lua/core.c b/src/scripting/lua/core.c index 25a06e43b..e11f79704 100644 --- a/src/scripting/lua/core.c +++ b/src/scripting/lua/core.c @@ -608,7 +608,7 @@ l_get_option(LS) break; case OPT_CODEPAGE: { - char *cp_name; + const char *cp_name; cp_name = get_cp_config_name(opt->value.number); lua_pushstring(S, cp_name);