diff options
author | Mike Heffner <mikeh@FreeBSD.org> | 2001-12-10 06:25:35 +0000 |
---|---|---|
committer | Mike Heffner <mikeh@FreeBSD.org> | 2001-12-10 06:25:35 +0000 |
commit | 0ca71ce75d1c22dafbaf561ed37acafe1897572a (patch) | |
tree | 981211e27180c1ebb8227819f5be9ac383384640 /usr.sbin/repquota | |
parent | d73796c5cf91504f11c073d2efa5fbeb95815d8f (diff) |
WARNS=2 cleanup.
Submitted by: Maxime Henrion <mux@qualys.com>
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=87597
Diffstat (limited to 'usr.sbin/repquota')
-rw-r--r-- | usr.sbin/repquota/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/repquota/repquota.c | 27 |
2 files changed, 17 insertions, 12 deletions
diff --git a/usr.sbin/repquota/Makefile b/usr.sbin/repquota/Makefile index 208abd6553a7..799ad8583b26 100644 --- a/usr.sbin/repquota/Makefile +++ b/usr.sbin/repquota/Makefile @@ -4,4 +4,6 @@ PROG= repquota MAN= repquota.8 +WARNS?= 2 + .include <bsd.prog.mk> diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c index b04bf1422a2c..c5501c8a1e13 100644 --- a/usr.sbin/repquota/repquota.c +++ b/usr.sbin/repquota/repquota.c @@ -78,8 +78,8 @@ static const char rcsid[] = #define max(a,b) ((a) >= (b) ? (a) : (b)) -char *qfname = QUOTAFILENAME; -char *qfextension[] = INITQFNAMES; +const char *qfname = QUOTAFILENAME; +const char *qfextension[] = INITQFNAMES; struct fileusage { struct fileusage *fu_next; @@ -90,8 +90,8 @@ struct fileusage { }; #define FUHASH 1024 /* must be power of two */ struct fileusage *fuhead[MAXQUOTAS][FUHASH]; -struct fileusage *lookup(); -struct fileusage *addid(); +struct fileusage *lookup(u_long, int); +struct fileusage *addid(u_long, int, char *); u_long highid[MAXQUOTAS]; /* highest addid()'ed identifier per type */ int vflag; /* verbose */ @@ -257,9 +257,9 @@ repquota(fs, type, qfpathname) fup->fu_dqblk.dqb_bsoftlimit ? timeprt(fup->fu_dqblk.dqb_btime) : "-"); printf(" %7lu %7lu %7lu %6s\n", - fup->fu_dqblk.dqb_curinodes, - fup->fu_dqblk.dqb_isoftlimit, - fup->fu_dqblk.dqb_ihardlimit, + (u_long)fup->fu_dqblk.dqb_curinodes, + (u_long)fup->fu_dqblk.dqb_isoftlimit, + (u_long)fup->fu_dqblk.dqb_ihardlimit, fup->fu_dqblk.dqb_isoftlimit && fup->fu_dqblk.dqb_curinodes >= fup->fu_dqblk.dqb_isoftlimit ? @@ -389,19 +389,22 @@ timeprt(seconds) if (now == 0) time(&now); - if (now > seconds) - return ("none"); + if (now > seconds) { + strlcpy(buf, "none", sizeof (buf)); + return (buf); + } seconds -= now; minutes = (seconds + 30) / 60; hours = (minutes + 30) / 60; if (hours >= 36) { - sprintf(buf, "%lddays", (hours + 12) / 24); + sprintf(buf, "%lddays", (long)(hours + 12) / 24); return (buf); } if (minutes >= 60) { - sprintf(buf, "%2ld:%ld", minutes / 60, minutes % 60); + sprintf(buf, "%2ld:%ld", (long)minutes / 60, + (long)minutes % 60); return (buf); } - sprintf(buf, "%2ld", minutes); + sprintf(buf, "%2ld", (long)minutes); return (buf); } |