From 187c4894d005555d361606a0066a01e3228ab962 Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Tue, 13 Apr 2021 10:33:52 +0200 Subject: [PATCH] swaymsg: Use "!ptr" for comparison to NULL Signed-off-by: Elyes HAOUAS --- swaymsg/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swaymsg/main.c b/swaymsg/main.c index 574d3b759..a526860c7 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -481,7 +481,7 @@ int main(int argc, char **argv) { // pretty print the json json_object *obj = json_tokener_parse(resp); - if (obj == NULL) { + if (!obj) { if (!quiet) { fprintf(stderr, "ERROR: Could not parse json response from ipc. " "This is a bug in sway."); @@ -518,7 +518,7 @@ int main(int argc, char **argv) { } json_object *obj = json_tokener_parse(reply->payload); - if (obj == NULL) { + if (!obj) { if (!quiet) { fprintf(stderr, "ERROR: Could not parse json response from" " ipc. This is a bug in sway.");