summaryrefslogtreecommitdiffstats
path: root/usr.sbin/repquota
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-05-29 09:45:08 +0000
committerderaadt <deraadt@openbsd.org>2002-05-29 09:45:08 +0000
commitead3e1cadbf2d38b554c16f5bb6d5e87379d25b0 (patch)
tree5e8e28aa4a7957de64d2f9710c756e7e28bb2f33 /usr.sbin/repquota
parentInitial fix: (diff)
downloadwireguard-openbsd-ead3e1cadbf2d38b554c16f5bb6d5e87379d25b0.tar.xz
wireguard-openbsd-ead3e1cadbf2d38b554c16f5bb6d5e87379d25b0.zip
more sprintf
Diffstat (limited to 'usr.sbin/repquota')
-rw-r--r--usr.sbin/repquota/repquota.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c
index 269bfeebecc..e63edea5356 100644
--- a/usr.sbin/repquota/repquota.c
+++ b/usr.sbin/repquota/repquota.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)repquota.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: repquota.c,v 1.16 2002/03/14 16:44:25 mpech Exp $";
+static char *rcsid = "$Id: repquota.c,v 1.17 2002/05/29 09:45:08 deraadt Exp $";
#endif /* not lint */
/*
@@ -388,13 +388,14 @@ timeprt(seconds)
minutes = (seconds + 30) / 60;
hours = (minutes + 30) / 60;
if (hours >= 36) {
- sprintf(buf, "%ddays", (hours + 12) / 24);
+ snprintf(buf, sizeof buf, "%ddays", (hours + 12) / 24);
return (buf);
}
if (minutes >= 60) {
- sprintf(buf, "%2d:%d", minutes / 60, minutes % 60);
+ snprintf(buf, sizeof buf, "%2d:%d", minutes / 60,
+ minutes % 60);
return (buf);
}
- sprintf(buf, "%2d", minutes);
+ snprintf(buf, sizeof buf, "%2d", minutes);
return (buf);
}