1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 17:53:13 +02:00

Revert "core, plugins: replace "%lx" by "%p" in calls to sscanf"

This reverts commit e64ab3c675.

This was causing incorrect conversion of strings "0x..." to pointers on systems
like Solaris/illumos.

And as a side effect, buffers were sometimes empty in weechat relay clients
like glowing-bear.
This commit is contained in:
Sébastien Helleu
2025-05-15 19:23:15 +02:00
parent d49c6515e4
commit 95a940294e
22 changed files with 95 additions and 63 deletions
+7 -10
View File
@@ -38,6 +38,7 @@ logger_info_log_file_cb (const void *pointer, void *data,
const char *arguments)
{
int rc;
unsigned long value;
struct t_gui_buffer *buffer;
struct t_logger_buffer *logger_buffer;
@@ -52,20 +53,16 @@ logger_info_log_file_cb (const void *pointer, void *data,
buffer = NULL;
if (strncmp (arguments, "0x", 2) == 0)
{
rc = sscanf (arguments, "%p", &buffer);
if ((rc != EOF) && (rc != 0) && buffer)
rc = sscanf (arguments, "%lx", &value);
if ((rc != EOF) && (rc != 0) && value)
{
if (!weechat_hdata_check_pointer (weechat_hdata_get ("buffer"),
NULL,
buffer))
if (weechat_hdata_check_pointer (weechat_hdata_get ("buffer"),
NULL,
(struct t_gui_buffer *)value))
{
buffer = NULL;
buffer = (struct t_gui_buffer *)value;
}
}
else
{
buffer = NULL;
}
}
else
{