summaryrefslogtreecommitdiff
path: root/bin/ksh/c_sh.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-19 17:39:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-04-19 17:39:46 +0000
commit204173d34708d82a330c658d8f32055a3451339b (patch)
treef08829e5a4aa68df938944531a80b189ac763248 /bin/ksh/c_sh.c
parent80a308d8dbef84cc8231ef51fa9d708d2d001aee (diff)
handle long long time_t
ok millert tedu
Diffstat (limited to 'bin/ksh/c_sh.c')
-rw-r--r--bin/ksh/c_sh.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/ksh/c_sh.c b/bin/ksh/c_sh.c
index bafe13e6c35..3691bfde49b 100644
--- a/bin/ksh/c_sh.c
+++ b/bin/ksh/c_sh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c_sh.c,v 1.42 2013/03/20 21:05:00 millert Exp $ */
+/* $OpenBSD: c_sh.c,v 1.43 2013/04/19 17:39:45 deraadt Exp $ */
/*
* built-in Bourne commands
@@ -665,11 +665,12 @@ p_time(struct shf *shf, int posix, struct timeval *tv, int width, char *prefix,
char *suffix)
{
if (posix)
- shf_fprintf(shf, "%s%*ld.%02ld%s", prefix ? prefix : "",
- width, tv->tv_sec, tv->tv_usec / 10000, suffix);
+ shf_fprintf(shf, "%s%*lld.%02ld%s", prefix ? prefix : "",
+ width, (long long)tv->tv_sec, tv->tv_usec / 10000, suffix);
else
- shf_fprintf(shf, "%s%*ldm%ld.%02lds%s", prefix ? prefix : "",
- width, tv->tv_sec / 60, tv->tv_sec % 60,
+ shf_fprintf(shf, "%s%*lldm%lld.%02lds%s", prefix ? prefix : "",
+ width, (long long)tv->tv_sec / 60,
+ (long long)tv->tv_sec % 60,
tv->tv_usec / 10000, suffix);
}