shithub: riscv

Download patch

ref: 022bc980b88ca6c06df2f4055ecc0b62231f01ea
parent: 878911b628207d05a1cf829235e61112bcae59f5
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Sep 25 12:32:32 EDT 2020

tmdate(2): fix mistakes in prototype (thanks moody)

--- a/sys/man/2/tmdate
+++ b/sys/man/2/tmdate
@@ -29,7 +29,7 @@
 };
 
 Tzone *tzload(char *name);
-Tm    *tmnow(Tm *tm, char *tz);
+Tm    *tmnow(Tm *tm, Tzone *tz);
 Tm    *tmtime(Tm *tm, vlong abs, Tzone *tz);
 Tm    *tmtimens(Tm *tm, vlong abs, int ns, Tzone *tz);
 Tm    *tmparse(Tm *dst, char *fmt, char *tm, Tzone *zone, char **ep);
@@ -221,14 +221,15 @@
 
 .IP
 .EX
+#define Fmt "?WWW, ?MM ?DD hh:mm:ss ?Z YYYY"
 Tm a, b;
 char *e;
 
-if(tmparse(&a, nil, "Tue Dec 10 12:36:00 PST 2019", &e) == nil)
+if(tmparse(&a, Fmt, "Tue Dec 10 12:36:00 PST 2019", &e) == nil)
 	sysfatal("failed to parse: %r");
 if(*e != '\0')
 	sysfatal("trailing junk %s", e);
-if(tmparse(&b, nil, "Tue Dec 10 15:36:00 EST 2019", &e) == nil)
+if(tmparse(&b, Fmt, "Tue Dec 10 15:36:00 EST 2019", &e) == nil)
 	sysfatal("failed to parse: %r");
 if(*e != '\0')
 	sysfatal("trailing junk %s", e);