mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[winpr,json] fix jansson return value check
json_object_set_new returns 0 on success, -1 on failure
This commit is contained in:
@@ -258,8 +258,8 @@ static WINPR_JSON* add_to_object(WINPR_JSON* object, const char* name, json_t* o
|
||||
{
|
||||
if (!obj)
|
||||
return NULL;
|
||||
const BOOL rc = (json_object_set_new(cast(object), name, obj) != 0);
|
||||
if (!rc)
|
||||
const int rc = json_object_set_new(cast(object), name, obj);
|
||||
if (rc != 0)
|
||||
return NULL;
|
||||
return revcast(obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user