From: Alejandro Colomar Date: Wed, 31 Jul 2024 12:35:15 +0000 (+0200) Subject: lib/, src/: Use local time for human-readable dates X-Git-Tag: 4.17.0-rc1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f5b4b56268269fefed55aa106f382037297d663;p=thirdparty%2Fshadow.git lib/, src/: Use local time for human-readable dates That is, use localtime_r(3) instead of gmtime_r(3). Closes: Reported-by: Gus Kenion Cc: Serge Hallyn Cc: Paul Eggert Signed-off-by: Alejandro Colomar --- diff --git a/lib/time/day_to_str.h b/lib/time/day_to_str.h index 374240f55..f908a7524 100644 --- a/lib/time/day_to_str.h +++ b/lib/time/day_to_str.h @@ -38,7 +38,7 @@ day_to_str(size_t size, char buf[size], long day) return; } - if (gmtime_r(&date, &tm) == NULL) { + if (localtime_r(&date, &tm) == NULL) { strtcpy(buf, "future", size); return; } diff --git a/src/chage.c b/src/chage.c index 1e296fca5..5146fde0a 100644 --- a/src/chage.c +++ b/src/chage.c @@ -242,7 +242,7 @@ print_day_as_date(long day) return; } - if (gmtime_r(&date, &tm) == NULL) { + if (localtime_r(&date, &tm) == NULL) { (void) printf ("time_t: %lu\n", (unsigned long)date); return; }