diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-09-25 21:22:47 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-09-25 21:22:47 -0700 |
commit | 9afa5550f7497f84fb157ba07ff94301dbe06bcc (patch) | |
tree | 56d5b716d6f0723787355a4189314e420868f503 | |
parent | eb6b1e672c33a9dce0de368a0e954b801f2035d3 (diff) | |
download | plan9front-9afa5550f7497f84fb157ba07ff94301dbe06bcc.tar.xz |
tmdate(1): fix missing arg, fix formatting (thanks joe9)
-rw-r--r-- | sys/man/2/tmdate | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/man/2/tmdate b/sys/man/2/tmdate index a99da78c7..eea689e3b 100644 --- a/sys/man/2/tmdate +++ b/sys/man/2/tmdate @@ -224,15 +224,17 @@ Done with full, strict error checking. .EX #define Fmt "?WWW, ?MM ?DD hh:mm:ss ?Z YYYY" Tm a, b; -char *e; +char *e, *est, *pst; -if(tmparse(&a, Fmt, "Tue Dec 10 12:36:00 PST 2019", &e) == nil) +pst = "Tue Dec 10 12:36:00 PST 2019"; +est = "Tue Dec 10 15:36:00 EST 2019"; +f(tmparse(&a, Fmt, pst, nil, &e) == nil) sysfatal("failed to parse: %r"); -if(*e != '\0') +if(*e != '\\0') sysfatal("trailing junk %s", e); -if(tmparse(&b, Fmt, "Tue Dec 10 15:36:00 EST 2019", &e) == nil) +if(tmparse(&b, Fmt, est, nil, &e) == nil) sysfatal("failed to parse: %r"); -if(*e != '\0') +if(*e != '\\0') sysfatal("trailing junk %s", e); if(tmnorm(a) == tmnorm(b) && a.nsec == b.nsec) print("same\\n"); |