1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 15:26:37 +02:00

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

This commit is contained in:
Sébastien Helleu
2024-06-14 17:59:02 +02:00
parent ce79d218a4
commit e64ab3c675
21 changed files with 62 additions and 91 deletions
+8 -8
View File
@@ -997,7 +997,7 @@ trigger_callback_line_cb (const void *pointer, void *data,
{
struct t_hashtable *hashtable;
struct t_weelist_item *ptr_item;
unsigned long value;
void *ptr;
const char *ptr_key, *ptr_value;
char **tags, *str_tags, *string_no_color;
int rc, num_tags, length;
@@ -1021,10 +1021,10 @@ trigger_callback_line_cb (const void *pointer, void *data,
ptr_value = weechat_hashtable_get (line, "buffer");
if (!ptr_value || (ptr_value[0] != '0') || (ptr_value[1] != 'x'))
goto end;
rc = sscanf (ptr_value + 2, "%lx", &value);
rc = sscanf (ptr_value, "%p", &ptr);
if ((rc == EOF) || (rc < 1))
goto end;
ctx.buffer = (void *)value;
ctx.buffer = ptr;
weechat_hashtable_set (ctx.pointers, "buffer", ctx.buffer);
ptr_value = weechat_hashtable_get (line, "tags");
@@ -1367,7 +1367,7 @@ trigger_callback_focus_cb (const void *pointer, void *data,
struct t_hashtable *info)
{
const char *ptr_value;
unsigned long value;
void *ptr;
int rc;
TRIGGER_CALLBACK_CB_INIT(info);
@@ -1381,16 +1381,16 @@ trigger_callback_focus_cb (const void *pointer, void *data,
ptr_value = weechat_hashtable_get (info, "_window");
if (ptr_value && ptr_value[0] && (strncmp (ptr_value, "0x", 2) == 0))
{
rc = sscanf (ptr_value + 2, "%lx", &value);
rc = sscanf (ptr_value, "%p", &ptr);
if ((rc != EOF) && (rc >= 1))
weechat_hashtable_set (ctx.pointers, "window", (void *)value);
weechat_hashtable_set (ctx.pointers, "window", ptr);
}
ptr_value = weechat_hashtable_get (info, "_buffer");
if (ptr_value && ptr_value[0] && (strncmp (ptr_value, "0x", 2) == 0))
{
rc = sscanf (ptr_value + 2, "%lx", &value);
rc = sscanf (ptr_value, "%p", &ptr);
if ((rc != EOF) && (rc >= 1))
weechat_hashtable_set (ctx.pointers, "buffer", (void *)value);
weechat_hashtable_set (ctx.pointers, "buffer", ptr);
}
/* execute the trigger (conditions, regex, command) */