diff --git a/ChangeLog b/ChangeLog index bc2023f07..a6b190148 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-12-01 +ChangeLog - 2006-12-04 Version 0.2.2 (under dev!): + * fixed bug with "set_config" function in plugins API (bug #18448) * plugins: "add_message_handler" now accepts "*" for all IRC messages * added keys (F9/F10) to scroll topic (task #6030) * added auto completion with channels and filenames (task #5423) diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c index b70ba9655..cda1474f3 100644 --- a/src/plugins/plugins-interface.c +++ b/src/plugins/plugins-interface.c @@ -796,9 +796,10 @@ weechat_plugin_set_config (t_weechat_plugin *plugin, char *option, char *value) { /* server config option modification */ server_name = (char *)malloc (pos - option + 1); - strncpy (server_name, option, pos - option); if (server_name) { + strncpy (server_name, option, pos - option); + server_name[pos - option] = '\0'; ptr_server = server_search (server_name); free (server_name); if (ptr_server) diff --git a/weechat/ChangeLog b/weechat/ChangeLog index bc2023f07..a6b190148 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2006-12-01 +ChangeLog - 2006-12-04 Version 0.2.2 (under dev!): + * fixed bug with "set_config" function in plugins API (bug #18448) * plugins: "add_message_handler" now accepts "*" for all IRC messages * added keys (F9/F10) to scroll topic (task #6030) * added auto completion with channels and filenames (task #5423) diff --git a/weechat/src/plugins/plugins-interface.c b/weechat/src/plugins/plugins-interface.c index b70ba9655..cda1474f3 100644 --- a/weechat/src/plugins/plugins-interface.c +++ b/weechat/src/plugins/plugins-interface.c @@ -796,9 +796,10 @@ weechat_plugin_set_config (t_weechat_plugin *plugin, char *option, char *value) { /* server config option modification */ server_name = (char *)malloc (pos - option + 1); - strncpy (server_name, option, pos - option); if (server_name) { + strncpy (server_name, option, pos - option); + server_name[pos - option] = '\0'; ptr_server = server_search (server_name); free (server_name); if (ptr_server)