From 46acfe96309f53e18c26445a1ede25d39c6571e0 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Thu, 21 May 2020 16:10:28 -0700 Subject: [PATCH] fixup! Update JSON parsing for backwards compatibility --- src/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network.c b/src/network.c index 41128a9..0ac7cd1 100644 --- a/src/network.c +++ b/src/network.c @@ -154,7 +154,7 @@ static int parse_status(char * raw_json) { write_log(PIHELPER_LOG_DEBUG, "%s", json_object_to_json_string_ext(jobj, JSON_C_TO_STRING_PRETTY)); json_object *status; const char * status_string; - if (json_object_object_get_ex(jobj, "/status", &status) == 0 + if (json_object_object_get_ex(jobj, "status", &status) == 1 && (status_string = json_object_get_string(status)) != NULL) { if (strstr(status_string, "enabled") == status_string) { retval = PIHELPER_ENABLED;