ref: 4fa9d73133e6e234e3a600747a8e9031571ab167
parent: 0ef319a787e4b99e4824f3f02e07548c8a98aff0
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Feb 9 08:08:01 EST 2026
astro: complete tz fix -- we support timezones longer than 3 chars now.
--- a/sys/src/cmd/astro/astro.h
+++ b/sys/src/cmd/astro/astro.h
@@ -75,7 +75,7 @@
struct Tim
{double ifa[5];
- char tz[4];
+ char tz[16];
};
double converge;
--- a/sys/src/cmd/astro/pdate.c
+++ b/sys/src/cmd/astro/pdate.c
@@ -113,7 +113,7 @@
h = t.ifa[3];
m = floor(t.ifa[4]);
s = floor((t.ifa[4]-m) * 60);
- print("%.2d:%.2d:%.2d %.*s", h, m, s, utfnlen(t.tz, 3), t.tz);+ print("%.2d:%.2d:%.2d %s", h, m, s, t.tz);}
char* unit[] =
@@ -306,7 +306,7 @@
/*
* kitchen clock correction
*/
- strncpy(t->tz, "GMT", sizeof(t->tz));
+ snprint(t->tz, sizeof(t->tz), "GMT");
if(flags['k'])
y = tzone(y, t);
return y;
--
⑨