1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-12-07 15:11:48 +00:00

lots of changes

SCCS-file: zic.c
SCCS-SID: 1.7
This commit is contained in:
Arthur David Olson
1986-02-28 23:15:35 -05:00
committed by Paul Eggert
parent d837e8f560
commit a7f488ad99

16
zic.c
View File

@ -821,6 +821,7 @@ register struct zone * zp;
t.tz_timecnt = 0;
t.tz_dsinfo[0].ds_gmtoff = zp->z_gmtoff;
t.tz_dsinfo[0].ds_isdst = 0;
lencheck(zp->z_format);
(void) strcpy(t.tz_dsinfo[0].ds_abbr, zp->z_format);
writezone(zp->z_name, &t);
return;
@ -834,11 +835,7 @@ register struct zone * zp;
for (i = 0; i < zp->z_nrules; ++i) {
rp = &zp->z_rules[i];
(void) sprintf(buf, zp->z_format, rp->r_abbrvar);
if (strlen(buf) > TZ_ABBR_LEN) {
(void) strcat(buf, " is too long as a Time Zone abbr.");
error(buf);
wildexit("input data");
}
lencheck(buf);
d = dzero;
(void) strcpy(d.ds_abbr, buf);
d.ds_gmtoff = zp->z_gmtoff + rp->r_stdoff;
@ -1093,3 +1090,12 @@ register long wantedy;
}
return tadd(t, rp->r_tod);
}
static
lencheck(string)
{
if (strlen(string) > TZ_ABBR_LEN) {
error("long time zone abbreviation");
wild2exit("long time zone abbreviation", string);
}
}