mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 21:06:38 +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:
@@ -41,6 +41,7 @@ script_mouse_focus_chat_cb (const void *pointer, void *data,
|
||||
{
|
||||
const char *buffer;
|
||||
int rc;
|
||||
unsigned long value;
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
long x;
|
||||
char *error, str_date[64];
|
||||
@@ -58,10 +59,12 @@ script_mouse_focus_chat_cb (const void *pointer, void *data,
|
||||
if (!buffer)
|
||||
return info;
|
||||
|
||||
rc = sscanf (buffer, "%p", &ptr_buffer);
|
||||
rc = sscanf (buffer, "%lx", &value);
|
||||
if ((rc == EOF) || (rc == 0))
|
||||
return info;
|
||||
|
||||
ptr_buffer = (struct t_gui_buffer *)value;
|
||||
|
||||
if (!ptr_buffer || (ptr_buffer != script_buffer))
|
||||
return info;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user