From bc9bbbe02c65a2b523c6307f0067a13e01481993 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 31 Jul 2010 17:41:58 +0000 Subject: [PATCH] Deal with proper format for printing time_t. Reported by: ache MFC after: 3 weeks --- bin/sleep/sleep.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c index a573cb5b9f8..f711a3f79fd 100644 --- a/bin/sleep/sleep.c +++ b/bin/sleep/sleep.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -131,9 +132,10 @@ main(int argc, char *argv[]) * Reporting does not bother with * fractions of a second... */ - warnx("about %ld second(s) left" - " out of the original %ld", - time_to_sleep.tv_sec, original); + warnx("about %jd second(s) left" + " out of the original %jd", + (intmax_t)time_to_sleep.tv_sec, + (intmax_t)original); report_requested = 0; } else break;