From f8282a29e5c3c750a5cb6979131d42c41c50abdc Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 7 Sep 2020 18:14:21 +0200 Subject: docs: Avoid dead expressions in code examples Spotted by Coverity. CID: #1491750 --- docs/reference/libtracker-sparql/examples/writeonly-example.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/libtracker-sparql/examples/writeonly-example.c b/docs/reference/libtracker-sparql/examples/writeonly-example.c index ed7fc0084..94104c3d7 100644 --- a/docs/reference/libtracker-sparql/examples/writeonly-example.c +++ b/docs/reference/libtracker-sparql/examples/writeonly-example.c @@ -17,9 +17,9 @@ int main (int argc, const char **argv) "}"; connection = tracker_sparql_connection_bus_new ("org.freedesktop.Tracker3.Miner.Files", NULL, NULL, &error); - if (!connection) { + if (!error) { g_printerr ("Couldn't obtain a connection to the Tracker store: %s", - error ? error->message : "unknown error"); + error->message); g_clear_error (&error); return 1; @@ -33,7 +33,7 @@ int main (int argc, const char **argv) if (error) { /* Some error happened performing the query, not good */ g_printerr ("Couldn't update the Tracker store: %s", - error ? error->message : "unknown error"); + error->message); g_clear_error (&error); g_object_unref (connection); -- cgit v1.2.1