[gcab/wip/hughsie/covscan: 3/3] trivial: Ignore Coverity warnings when not checking setenv()




commit afa16b723ff70a91bf9eabc1f91314834edfd04a
Author: Richard Hughes <richard hughsie com>
Date:   Wed Apr 13 13:46:05 2022 +0100

    trivial: Ignore Coverity warnings when not checking setenv()

 src/gcab-fuzz.c        | 2 +-
 tests/gcab-self-test.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/gcab-fuzz.c b/src/gcab-fuzz.c
index e66003d..672b963 100644
--- a/src/gcab-fuzz.c
+++ b/src/gcab-fuzz.c
@@ -68,7 +68,7 @@ main (int argc, char *argv[])
     }
 
     /* try to extract each file */
-    g_setenv ("GCAB_SKIP_CHECKSUM", "1", FALSE);
+    (void)g_setenv ("GCAB_SKIP_CHECKSUM", "1", FALSE);
     for (gint i = 1; i < argc; i++) {
         g_autoptr(GFile) file = g_file_new_for_commandline_arg (argv[i]);
         if (!_process_file (file, &error)) {
diff --git a/tests/gcab-self-test.c b/tests/gcab-self-test.c
index c9b2aab..66f1edb 100644
--- a/tests/gcab-self-test.c
+++ b/tests/gcab-self-test.c
@@ -419,7 +419,7 @@ gcab_test_cabinet_error_cves_func (void)
             "CVE-2015-4470.cab",
             "CVE-2015-4471.cab",
             NULL };
-    g_setenv ("GCAB_SKIP_CHECKSUM", "1", TRUE);
+    (void)g_setenv ("GCAB_SKIP_CHECKSUM", "1", TRUE);
     for (guint i = 0; tests[i] != NULL; i++) {
         gboolean ret;
         g_autofree gchar *fn = NULL;
@@ -572,7 +572,7 @@ main (int argc, char **argv)
 
     /* only critical and error are fatal */
     g_log_set_fatal_mask (NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
-    g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
+    (void)g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
 
     /* tests go here */
     g_test_add_func ("/GCab/file", gcab_test_file_func);


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