From a67685628504d92b80eabe7cdc02c500f12b4873 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 27 Jun 2008 10:54:23 +0200 Subject: factor out time_t-to-string conversion idiom * src/system.h: Include "inttostr.h". (timetostr): New function, factored out of... * src/date.c (show_date): Use timetostr. * src/du.c (show_date): Likewise. * src/ls.c (print_long_format): Likewise. * src/pinky.c (time_string): Likewise. * src/stat.c (human_time): Likewise. * src/*.c: Don't include inttostr.h, since system.h does. * src/c99-to-c89.diff: Adjust offsets. --- src/date.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/date.c') diff --git a/src/date.c b/src/date.c index 24390529c..9592bf816 100644 --- a/src/date.c +++ b/src/date.c @@ -28,7 +28,6 @@ #include "argmatch.h" #include "error.h" #include "getdate.h" -#include "inttostr.h" #include "posixtm.h" #include "quote.h" #include "stat-time.h" @@ -540,10 +539,7 @@ show_date (const char *format, struct timespec when) if (! tm) { char buf[INT_BUFSIZE_BOUND (intmax_t)]; - error (0, 0, _("time %s is out of range"), - (TYPE_SIGNED (time_t) - ? imaxtostr (when.tv_sec, buf) - : umaxtostr (when.tv_sec, buf))); + error (0, 0, _("time %s is out of range"), timetostr (when.tv_sec, buf)); return false; } -- cgit v1.2.3-54-g00ecf