[Pkg-wmaker-commits] [wmcoincoin] 44/87: Fix -Wunused-result compiler warnings.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Aug 28 17:27:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmcoincoin.

commit 5891dbbd3a001333846cd8c11bb01cc7815cb908
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Tue Nov 11 12:13:46 2014 -0600

    Fix -Wunused-result compiler warnings.
---
 platypus/gifread.c    | 5 ++++-
 src/board.c           | 6 ++++--
 src/pinnipede.c       | 3 ++-
 src/pinnipede_totoz.c | 3 ++-
 src/raster.c          | 4 +++-
 src/wmcoincoin.c      | 3 ++-
 6 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/platypus/gifread.c b/platypus/gifread.c
index 99e7883..a4ad9c6 100644
--- a/platypus/gifread.c
+++ b/platypus/gifread.c
@@ -89,7 +89,10 @@ file_byte_getter(Gif_Reader *grr)
 static void
 file_block_getter(uint8_t *p, uint32_t s, Gif_Reader *grr)
 {
-  fread(p, 1, s, grr->f);
+	size_t bytes_read;
+
+	bytes_read = fread(p, 1, s, grr->f);
+	assert(bytes_read == s && !ferror(grr->f));
 }
 
 static uint32_t
diff --git a/src/board.c b/src/board.c
index 6722508..9cb46bd 100644
--- a/src/board.c
+++ b/src/board.c
@@ -367,7 +367,8 @@ void board_restore_state(FILE *f, Board *board) {
     board->time_shift_max = tmax;
     board->time_shift = t;
   }
-  fscanf(f, "last_viewed_id=%d", &board->last_viewed_id);
+  if (fscanf(f, "last_viewed_id=%d", &board->last_viewed_id) == EOF)
+    myfprintf(stderr, "fscanf() failed\n");
   if (board_is_rss_feed(board) || board_is_pop3(board)) {
     board->last_viewed_id = -1; /* on dispose d'une liste de md5 */
     release_md5_array(board);
@@ -1638,7 +1639,8 @@ board_call_external_(Board *board, int last_id, char *cmd) {
     subs[9] = qhost;
     shift_cmd = str_multi_substitute(cmd, keys, subs, 10);
     BLAHBLAH(2, myprintf("post_cmd: /bin/sh -c %<YEL %s>\n", shift_cmd));
-    system(shift_cmd);
+    if (system(shift_cmd) == -1)
+      myfprintf(stderr, "%s failed\n", shift_cmd);
 
     free(shift_cmd);
     free(qlogin);
diff --git a/src/pinnipede.c b/src/pinnipede.c
index 6a79801..6943b4b 100644
--- a/src/pinnipede.c
+++ b/src/pinnipede.c
@@ -4255,7 +4255,8 @@ pp_restore_state(Dock *dock, FILE *f) {
       int i;
       pp->nb_visited_links = nlnk;
       for (i=0; i < pp->nb_visited_links; i++) {
-	fscanf(f, "%d\n", &pp->visited_links[i]);
+        if (fscanf(f, "%d\n", &pp->visited_links[i]) == EOF)
+          myfprintf(stderr, "fscanf() failed\n");
       }
     }
     pp_tabs_restore_state(dock,f);
diff --git a/src/pinnipede_totoz.c b/src/pinnipede_totoz.c
index c639189..4e310c6 100644
--- a/src/pinnipede_totoz.c
+++ b/src/pinnipede_totoz.c
@@ -502,7 +502,8 @@ pp_totoz_get_image(Dock *dock, unsigned char *imgname) {
         } else {
           fclose(f);
           cmd = str_printf("echo \"%s.%s\" `wmcoincoin_player -i \"%s\"` \"%s\" > \"%s\"", imgfname, extlist[i], pathimg, mimelist[i], pathdesc);
-          system(cmd);
+          if (system(cmd) == -1)
+            myfprintf(stderr, "%s failed\n", cmd);
           free(cmd);
           pp_totoz_register_img(dock->pinnipede, imgname, PP_TOTOZ_STATUS_FOUND);
           pp_totoz_update_status(dock, imgname);
diff --git a/src/raster.c b/src/raster.c
index 9749c9c..10be0f9 100644
--- a/src/raster.c
+++ b/src/raster.c
@@ -449,7 +449,9 @@ RGBACreatePixmapFromXpmFile(RGBAContext *ctx, char *xpm_file, int *w, int *h)
       fprintf(stderr, _("Error while reading '%s' !? [%s]\n"), xpm_file, strerror(errno));
     }
 
-    l[0] = 0; fgets(l, LEN_MAX, f);
+    l[0] = 0;
+    if (!fgets(l, LEN_MAX, f))
+      fprintf(stderr, "fgets() failed: %s\n", strerror(errno));
     
     /* on ne prend en compte QUE LES LIGNES QUI COMMENCE PAR '"' et QUI SE TERMINENT PAR '",' */
     
diff --git a/src/wmcoincoin.c b/src/wmcoincoin.c
index 12232d9..f6d236a 100644
--- a/src/wmcoincoin.c
+++ b/src/wmcoincoin.c
@@ -491,7 +491,8 @@ open_url(const unsigned char *url, int balloon_x, int balloon_y, int browser_num
   /*
     system fait appel � /bin/sh , mais on a backslash� tous les caract�res embetants
   */
-  system(s);
+  if (system(s) == -1)
+	  myfprintf(stderr, "%s failed\n", s);
 }
 
 int

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmcoincoin.git



More information about the Pkg-wmaker-commits mailing list