1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

api: fix add of infolist items in hashtable when prefix contains UTF-8 chars in function hashtable_add_from_infolist (issue #1739)

This commit is contained in:
Sébastien Helleu
2022-01-15 09:46:10 +01:00
parent bda7bb64d2
commit c13aa86c79
2 changed files with 6 additions and 3 deletions
+1
View File
@@ -28,6 +28,7 @@ Bug fixes::
* core: fix search of commands with UTF-8 chars in name when option weechat.look.command_incomplete is on (issue #1739)
* core: fix display of hotlist in buflist after changing value of option weechat.look.hotlist_sort (issue #1733)
* api: fix add of infolist items in hashtable when prefix contains UTF-8 chars in function hashtable_add_from_infolist (issue #1739)
* irc: fix parsing of messages 311, 312, 327 (whois) and 314 (whowas) in case of missing parameters
* irc: fix parsing of message 338 (whois, host) sent by Rizon server (issue #1737)
* irc: fix display of message 344 received as whois geo info (issue #1736)
+5 -3
View File
@@ -34,6 +34,7 @@
#include "wee-list.h"
#include "wee-log.h"
#include "wee-string.h"
#include "wee-utf8.h"
#include "../plugins/plugin.h"
@@ -1123,8 +1124,8 @@ hashtable_add_from_infolist (struct t_hashtable *hashtable,
const char *prefix)
{
struct t_infolist_var *ptr_name, *ptr_value;
char prefix_name[128], option_value[128];
int prefix_length;
char prefix_name[1024], option_value[1024];
int prefix_length, prefix_length_utf8;
if (!hashtable || !infolist || !infolist->ptr_item || !prefix)
return 0;
@@ -1135,12 +1136,13 @@ hashtable_add_from_infolist (struct t_hashtable *hashtable,
snprintf (prefix_name, sizeof (prefix_name), "%s_name_", prefix);
prefix_length = strlen (prefix_name);
prefix_length_utf8 = utf8_strlen (prefix_name);
for (ptr_name = infolist->ptr_item->vars; ptr_name;
ptr_name = ptr_name->next_var)
{
if (string_strncasecmp (ptr_name->name, prefix_name,
prefix_length) == 0)
prefix_length_utf8) == 0)
{
snprintf (option_value, sizeof (option_value),
"%s_value_%s", prefix, ptr_name->name + prefix_length);