mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
json-util: don't use assert_return()
assert_return() exists for gracefully handling programmng errors in public APIs. But these are internal APIs, hence just use a tough assert().
This commit is contained in:
@@ -190,7 +190,7 @@ int json_dispatch_path(const char *name, sd_json_variant *variant, sd_json_dispa
|
||||
const char *path;
|
||||
int r;
|
||||
|
||||
assert_return(variant, -EINVAL);
|
||||
assert(variant);
|
||||
|
||||
r = json_dispatch_const_path(name, variant, flags, &path);
|
||||
if (r < 0)
|
||||
@@ -256,7 +256,7 @@ int json_dispatch_filename(const char *name, sd_json_variant *variant, sd_json_d
|
||||
const char *filename;
|
||||
int r;
|
||||
|
||||
assert_return(variant, -EINVAL);
|
||||
assert(variant);
|
||||
|
||||
r = json_dispatch_const_filename(name, variant, flags, &filename);
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user