1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +02:00

Added string length limit for setup file options

This commit is contained in:
Sebastien Helleu
2007-08-29 12:53:35 +00:00
parent ebae0cb7d5
commit 882b72cd0c
14 changed files with 601 additions and 369 deletions
+3 -1
View File
@@ -290,7 +290,7 @@ t_config_option weechat_options_look[] =
"%a, %d %b %Y", NULL, NULL, &cfg_look_day_change_timestamp, config_change_noop },
{ "look_read_marker", N_("use a marker on servers/channels to show first unread line"),
N_("use a marker on servers/channels to show first unread line"),
OPTION_TYPE_STRING, 0, 0, 0,
OPTION_TYPE_STRING, 0, 1, 0,
" ", NULL, NULL, &cfg_look_read_marker, config_change_read_marker },
{ "look_input_format", N_("format for input prompt"),
N_("format for input prompt ('%c' is replaced by channel or server, "
@@ -1430,6 +1430,8 @@ config_option_set_value (t_config_option *option, char *value)
return -1;
break;
case OPTION_TYPE_STRING:
if ((option->max > 0) && (utf8_strlen (value) > option->max))
return -1;
if (*(option->ptr_string))
free (*(option->ptr_string));
*(option->ptr_string) = strdup (value);