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

relay/api: replace direct access to JSON number value by call to function cJSON_GetNumberValue() (issue #2066)

This commit is contained in:
Sébastien Helleu
2024-03-31 21:03:56 +02:00
parent cb785d5035
commit 64db1b958d
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -516,7 +516,7 @@ RELAY_API_PROTOCOL_CALLBACK(input)
if (cJSON_IsNumber (json_buffer_id))
{
snprintf (str_id, sizeof (str_id),
"%lld", (long long)json_buffer_id->valuedouble);
"%lld", (long long)cJSON_GetNumberValue (json_buffer_id));
ptr_buffer = weechat_buffer_search ("==id", str_id);
if (!ptr_buffer)
{
@@ -524,7 +524,7 @@ RELAY_API_PROTOCOL_CALLBACK(input)
client,
RELAY_HTTP_404_NOT_FOUND, NULL,
"Buffer \"%lld\" not found",
(long long)json_buffer_id->valuedouble);
(long long)cJSON_GetNumberValue (json_buffer_id));
cJSON_Delete (json_body);
return WEECHAT_RC_OK;
}