mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 11:43: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:
@@ -1422,6 +1422,7 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
|
||||
void *pointer;
|
||||
struct t_hdata *hdata;
|
||||
int rc;
|
||||
unsigned long ptr;
|
||||
|
||||
value = NULL;
|
||||
hdata_name = NULL;
|
||||
@@ -1473,9 +1474,10 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
|
||||
{
|
||||
if (strncmp (pointer_name, "0x", 2) == 0)
|
||||
{
|
||||
rc = sscanf (pointer_name, "%p", &pointer);
|
||||
rc = sscanf (pointer_name, "%lx", &ptr);
|
||||
if ((rc != EOF) && (rc != 0))
|
||||
{
|
||||
pointer = (void *)ptr;
|
||||
if (!hdata_check_pointer (hdata, NULL, pointer))
|
||||
goto end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user