xbps_get_pkg_state_*: if state object is not available return EINVAL.
This commit is contained in:
parent
927d7e0c5d
commit
692caea1cd
@ -87,8 +87,9 @@ get_state(prop_dictionary_t dict)
|
|||||||
|
|
||||||
assert(dict != NULL);
|
assert(dict != NULL);
|
||||||
|
|
||||||
prop_dictionary_get_cstring_nocopy(dict, "state", &state_str);
|
if (!prop_dictionary_get_cstring_nocopy(dict,
|
||||||
assert(state_str != NULL);
|
"state", &state_str))
|
||||||
|
return 0;
|
||||||
|
|
||||||
for (stp = states; stp->string != NULL; stp++)
|
for (stp = states; stp->string != NULL; stp++)
|
||||||
if (strcmp(state_str, stp->string) == 0)
|
if (strcmp(state_str, stp->string) == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user