fix strftime %s not to zero pad with default width=2
authorSzabolcs Nagy <nsz@port70.net>
Thu, 8 May 2014 17:04:48 +0000 (19:04 +0200)
committerRich Felker <dalias@aerifal.cx>
Tue, 20 May 2014 21:58:25 +0000 (17:58 -0400)
(cherry picked from commit ac0acd569e01735fc6052d43fdf57f3a07c93f3d)

src/time/strftime.c

index bc150139ee309b4990c9ad29041d8dd5f585c739..75ebca62944987676ac712afba3e2f015e2cf8e5 100644 (file)
@@ -126,6 +126,7 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *
                goto recu_strftime;
        case 's':
                val = __tm_to_secs(tm) + tm->__tm_gmtoff;
+               width = 1;
                goto number;
        case 'S':
                val = tm->tm_sec;