[winpr,json] fix jansson return value check

json_object_set_new returns 0 on success, -1 on failure
This commit is contained in:
Armin Novak
2025-09-30 17:04:22 +02:00
parent 5c69cf1406
commit b2783956bf

View File

@@ -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);
}