]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
chage: Fix regression in print_date
authorXiami <1927254+Xiami2012@users.noreply.github.com>
Wed, 5 Oct 2022 10:11:28 +0000 (18:11 +0800)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Wed, 5 Oct 2022 10:43:45 +0000 (12:43 +0200)
Introduced by c6c8130db4319613a91dd07bbb845f6c33c5f79f

After removing snprintf, the format string should get unescaped once.

Fixes #564

Reporter and patch author: DerMouse (github.com/DerMouse)

src/chage.c

index 8cf6779421a769f28b636bd2faac206e3c4e1005..01570d725e13dbc7fae24b2e63114f89cf164f6f 100644 (file)
@@ -228,7 +228,7 @@ static void print_date (time_t date)
        if (NULL == tp) {
                (void) printf ("time_t: %lu\n", (unsigned long)date);
        } else {
-               (void) strftime (buf, sizeof buf, iflg ? "%%Y-%%m-%%d" : "%%b %%d, %%Y", tp);
+               (void) strftime (buf, sizeof buf, iflg ? "%Y-%m-%d" : "%b %d, %Y", tp);
                (void) puts (buf);
        }
 }