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.
This commit is contained in:
Doug Torrance 2015-01-22 00:22:10 -06:00 committed by Carlos R. Mafra
parent 331af1daa2
commit 9b9ef2f6d2

View file

@ -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 (