summaryrefslogtreecommitdiff
path: root/usr.bin/sup
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-05-07 02:08:03 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-05-07 02:08:03 +0000
commitb9680e2bb213866c22aaf7440309ed39647d36a6 (patch)
treeae88788fdf9df78a6234677dc4865eb984ae9686 /usr.bin/sup
parent47aee540c098b31ecbf013ea7b5c5ff0af1dc7d2 (diff)
Use a smaller buffer in fmttime() since the date string is of a
known fixed size.
Diffstat (limited to 'usr.bin/sup')
-rw-r--r--usr.bin/sup/src/supcmisc.c9
-rw-r--r--usr.bin/sup/src/supfilesrv.c8
2 files changed, 9 insertions, 8 deletions
diff --git a/usr.bin/sup/src/supcmisc.c b/usr.bin/sup/src/supcmisc.c
index 0c3b0c6d930..dd8bdbdc466 100644
--- a/usr.bin/sup/src/supcmisc.c
+++ b/usr.bin/sup/src/supcmisc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supcmisc.c,v 1.10 2001/05/05 15:56:04 millert Exp $ */
+/* $OpenBSD: supcmisc.c,v 1.11 2001/05/07 02:08:02 millert Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -353,10 +353,11 @@ lockout(on) /* lock out interrupts */
}
}
-char *fmttime(time)
+char *
+fmttime(time)
time_t time;
{
- static char buf[STRINGLENGTH];
+ static char buf[16];
char *p;
/*
@@ -364,6 +365,6 @@ char *fmttime(time)
* E.g.: "Thu Nov 24 18:22:48 1986\n" -> "Nov 24 18:22:48"
*/
p = ctime(&time) + 4;
- (void) strlcpy(buf, p, strlen(p) - 5);
+ (void) strlcpy(buf, p, sizeof(buf));
return (buf);
}
diff --git a/usr.bin/sup/src/supfilesrv.c b/usr.bin/sup/src/supfilesrv.c
index 907c52eb21c..6e0f8ef4363 100644
--- a/usr.bin/sup/src/supfilesrv.c
+++ b/usr.bin/sup/src/supfilesrv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supfilesrv.c,v 1.22 2001/05/04 22:16:17 millert Exp $ */
+/* $OpenBSD: supfilesrv.c,v 1.23 2001/05/07 02:08:02 millert Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -1907,10 +1907,10 @@ va_dcl
}
char *
-fmttime (time)
+fmttime(time)
time_t time;
{
- static char buf[STRINGLENGTH];
+ static char buf[16];
char *p;
/*
@@ -1918,7 +1918,7 @@ fmttime (time)
* E.g.: "Thu Nov 24 18:22:48 1986\n" -> "Nov 24 18:22:48"
*/
p = ctime(&time) + 4;
- (void) strlcpy(buf, p, strlen(p) - 5);
+ (void) strlcpy(buf, p, sizeof(buf));
return (buf);
}