[Pkg-wmaker-commits] [wmfsm] 24/83: wmfsm: Fix -Wunused-result compiler warnings.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sun Aug 23 14:05:42 UTC 2015


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

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

commit 1366e9da52c959a0cb1e3296e2180029982470b7
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Thu Jan 22 00:22:10 2015 -0600

    wmfsm: Fix -Wunused-result compiler warnings.
    
    In particular, if fscanf does not read the expected number of items from
    /etc/mtab, print a warning message.
---
 wmfsm/wmfsm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/wmfsm/wmfsm.c b/wmfsm/wmfsm.c
index add5290..01bf326 100644
--- a/wmfsm/wmfsm.c
+++ b/wmfsm/wmfsm.c
@@ -512,9 +512,11 @@ readFileSystems()
 	while (!feof(fp) && numberfs < 100) {
 #if defined(SunOS)
 		/* only five entries per row in /etc/mnttab */
-		fscanf(fp, "%s %s %s %s %s\n", dummy, mountPoint, fstype, options, dummy);
+		if (fscanf(fp, "%s %s %s %s %s\n", dummy, mountPoint, fstype, options, dummy) < 5)
+			fprintf(stderr, "%s:/etc/mnttab not in expected format\n", myName);
 #else
-		fscanf(fp, "%s %s %s %s %s %s\n", dummy, mountPoint, fstype, options, dummy, dummy);
+		if (fscanf(fp, "%s %s %s %s %s %s\n", dummy, mountPoint, fstype, options, dummy, dummy) < 6)
+			fprintf(stderr, "%s:/etc/mtab not in expected format\n", myName);
 #endif
 
 		if (

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



More information about the Pkg-wmaker-commits mailing list