[glom] glom_import_po_all: Check the save() return value.



commit fba8373817ef02fede3447663eae1b3293d8e63b
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Dec 3 10:27:18 2014 +0100

    glom_import_po_all: Check the save() return value.
    
    Found by Coverity Scan.

 glom/glom_import_po_all.cc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/glom/glom_import_po_all.cc b/glom/glom_import_po_all.cc
index 9abd60b..cac796c 100644
--- a/glom/glom_import_po_all.cc
+++ b/glom/glom_import_po_all.cc
@@ -213,7 +213,11 @@ int main(int argc, char* argv[])
       std::cerr << Glib::ustring::compose(_("Po file import failed for locale: %1"), locale_id) << std::endl;
       return EXIT_FAILURE;
     }
-    document.save();
+
+    if(!document.save()) {
+      std::cerr << Glib::ustring::compose(_("Po file import failed during document saving for locale: %1"), 
locale_id) << std::endl;
+      return EXIT_FAILURE;
+    }
 
     std::cout << Glib::ustring::compose(_("Po file imported for locale: %1 for file %2"), locale_id, 
input_uri) << std::endl;
   }


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