[Pkg-wmaker-commits] [wmsysmon] 05/13: Fix "ignoring return value of ‘fscanf’" compiler warning.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Tue Nov 22 19:52:02 UTC 2016


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

dtorrance-guest pushed a commit to branch upstream
in repository wmsysmon.

commit 6daa0ed20369397d8223d5cad7b8c9d66170e40f
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Fri Jul 17 10:00:44 2015 -0600

    Fix "ignoring return value of ‘fscanf’" compiler warning.
    
    Origin: https://sources.debian.net/src/wmsysmon/0.7.7-8/debian/patches/unused-result.patch/
---
 src/wmsysmon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/wmsysmon.c b/src/wmsysmon.c
index ce3df89..d413224 100644
--- a/src/wmsysmon.c
+++ b/src/wmsysmon.c
@@ -233,7 +233,8 @@ void wmsysmon_routine(int argc, char **argv)
     /* init uptime */
 	fp = fopen("/proc/uptime", "r");
 	if (fp) {
-		fscanf(fp, "%ld", &start_time);
+		if (fscanf(fp, "%ld", &start_time) < 1)
+			fprintf(stderr, "warning: could not read uptime\n");
 		fclose(fp);
 		start_uptime = time(NULL);
 	}

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



More information about the Pkg-wmaker-commits mailing list