1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16:38 +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
+3 -3
View File
@@ -395,7 +395,7 @@ plugin_script_str2ptr (struct t_weechat_plugin *weechat_plugin,
const char *script_name, const char *function_name,
const char *str_pointer)
{
unsigned long value;
void *pointer;
int rc;
struct t_gui_buffer *ptr_buffer;
@@ -405,9 +405,9 @@ plugin_script_str2ptr (struct t_weechat_plugin *weechat_plugin,
if ((str_pointer[0] != '0') || (str_pointer[1] != 'x'))
goto invalid;
rc = sscanf (str_pointer + 2, "%lx", &value);
rc = sscanf (str_pointer, "%p", &pointer);
if ((rc != EOF) && (rc >= 1))
return (void *)value;
return pointer;
invalid:
if ((weechat_plugin->debug >= 1) && script_name && function_name)