]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/chage.c: print_day_as_date(): Simplify error handling
authorAlejandro Colomar <alx@kernel.org>
Wed, 31 Jul 2024 12:53:12 +0000 (14:53 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 23 Aug 2024 03:51:57 +0000 (22:51 -0500)
If localtime_r(3) fails, just print future, as we do in day_to_str().
It should only fail for unrealistic dates, if at all.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/chage.c

index c990953b5ca886397ded092f62d49406bb0d33be..95adb593d4f2dea52b5aacbc5d37991e1b61cba0 100644 (file)
@@ -243,7 +243,7 @@ print_day_as_date(long day)
        }
 
        if (localtime_r(&date, &tm) == NULL) {
-               (void) printf ("time_t: %lu\n", (unsigned long)date);
+               puts(_("future"));
                return;
        }