[tracker/wip/carlosg/coverity-fixes: 4/7] docs: Avoid dead expressions in code examples




commit 87e189d5a0bb033ce03628820dd1dea670860125
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 7 18:12:54 2020 +0200

    docs: Avoid dead expressions in code examples
    
    Spotted by Coverity.
    
    CID: #1491749

 .../libtracker-sparql/examples/writeonly-with-blank-nodes-example.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/libtracker-sparql/examples/writeonly-with-blank-nodes-example.c 
b/docs/reference/libtracker-sparql/examples/writeonly-with-blank-nodes-example.c
index 80b6bcd4c..558c7e55d 100644
--- a/docs/reference/libtracker-sparql/examples/writeonly-with-blank-nodes-example.c
+++ b/docs/reference/libtracker-sparql/examples/writeonly-with-blank-nodes-example.c
@@ -9,9 +9,9 @@ int main (int argc, const char **argv)
     "INSERT { _:foo a nie:InformationElement } WHERE { ?x a rdfs:Class }";
 
   connection = tracker_sparql_connection_bus_new ("org.freedesktop.Tracker1", 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;
@@ -26,7 +26,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]