]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
getValue returns true/false
authorMartin Vidner <mvidner@suse.cz>
Mon, 9 Dec 2019 14:58:54 +0000 (15:58 +0100)
committerMartin Vidner <mvidner@suse.cz>
Fri, 13 Dec 2019 15:31:47 +0000 (16:31 +0100)
consistently with other functions

snapper/XmlFile.cc

index c1972ac18890eb70acbdd4819c91cba4e6261be5..bf3f6385a6a1d9bce2afe1742e1ac2ae527ea8a6 100644 (file)
@@ -142,11 +142,10 @@ namespace snapper
     {
        xmlChar* tmp = xmlNodeGetContent(node);
        if (tmp == nullptr)
-           value = "";
-       else {
-           value = (const char *) tmp;
-           xmlFree(tmp);
-       }
+           return false;
+
+       value = (const char *) tmp;
+       xmlFree(tmp);
        return true;
     }
 
@@ -190,6 +189,7 @@ namespace snapper
        xmlChar* tmp = xmlGetNoNsProp(node, (const xmlChar *) name);
        if (tmp == nullptr)
            return false;
+
        value = (const char *) tmp;
        xmlFree(tmp);
        return true;