[hackers] [sbase] date: Fix default format string || Richard Ipsum

From: <git_AT_suckless.org>
Date: Sat, 13 Apr 2019 04:46:40 +0200 (CEST)

commit 09c2311b3a3d8514f2edf0b08a389e7eeba404ce
Author: Richard Ipsum <richardipsum_AT_fastmail.co.uk>
AuthorDate: Sat Apr 13 03:11:26 2019 +0100
Commit: Michael Forney <mforney_AT_mforney.org>
CommitDate: Fri Apr 12 19:40:34 2019 -0700

    date: Fix default format string
    
    From POSIX:
    
    When no formatting operand is specified, the output in the POSIX
    locale shall be equivalent to specifying:
    
               date "+%a %b %e %H:%M:%S %Z %Y"

diff --git a/date.c b/date.c
index 97c910c..109f371 100644
--- a/date.c
+++ b/date.c
_AT_@ -66,7 +66,7 @@ main(int argc, char *argv[])
 {
         struct tm *now;
         time_t t;
- char buf[BUFSIZ], *fmt = "%c";
+ char buf[BUFSIZ], *fmt = "%a %b %e %H:%M:%S %Z %Y";
 
         t = time(NULL);
         if (t == -1)
Received on Sat Apr 13 2019 - 04:46:40 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 13 2019 - 04:48:22 CEST