aboutsummaryrefslogtreecommitdiff
path: root/bin/ps
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-06-28 18:19:13 +0000
committerBruce Evans <bde@FreeBSD.org>1998-06-28 18:19:13 +0000
commitf8ec5fe2822fc750ad7330211407984bdee52cdd (patch)
treedffdc1ef93cf0993248f0ec7635a57913066fa23 /bin/ps
parent0eb7b1cad087ee61e16fa96fa68b5dbe191f3dc4 (diff)
downloadsrc-f8ec5fe2822fc750ad7330211407984bdee52cdd.tar.gz
src-f8ec5fe2822fc750ad7330211407984bdee52cdd.zip
Fixed printf format errors.
Notes
Notes: svn path=/head/; revision=37231
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/print.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 40ad844b197b..00a8ca9a6fbf 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$Id: print.c,v 1.27 1998/05/28 09:29:43 phk Exp $";
+ "$Id: print.c,v 1.28 1998/05/31 12:09:50 bde Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -341,6 +341,7 @@ started(k, ve)
{
VAR *v;
static time_t now;
+ time_t then;
struct tm *tp;
char buf[100];
@@ -350,7 +351,8 @@ started(k, ve)
return;
}
- tp = localtime(&k->ki_u.u_start.tv_sec);
+ then = k->ki_u.u_start.tv_sec;
+ tp = localtime(&then);
if (!now)
(void)time(&now);
if (now - k->ki_u.u_start.tv_sec < 24 * 3600) {
@@ -372,6 +374,7 @@ lstarted(k, ve)
VARENT *ve;
{
VAR *v;
+ time_t then;
char buf[100];
v = ve->var;
@@ -379,8 +382,8 @@ lstarted(k, ve)
(void)printf("%-*s", v->width, "-");
return;
}
- (void)strftime(buf, sizeof(buf) -1, "%c",
- localtime(&k->ki_u.u_start.tv_sec));
+ then = k->ki_u.u_start.tv_sec;
+ (void)strftime(buf, sizeof(buf) -1, "%c", localtime(&then));
(void)printf("%-*s", v->width, buf);
}