tzcode: Fully initialize structs before use.

Reported by:	Coverity (CID 1502542, 1502548)
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38037
This commit is contained in:
Dag-Erling Smørgrav 2023-01-13 15:59:05 +01:00
parent 96e68c393f
commit 55572cff58

View file

@ -1842,7 +1842,7 @@ getsave(char *field, bool *isdst)
static void
inrule(char **fields, int nfields)
{
struct rule r;
struct rule r = { 0 };
if (nfields != RULE_FIELDS) {
error(_("wrong number of fields on Rule line"));
@ -1921,7 +1921,7 @@ inzsub(char **fields, int nfields, bool iscont)
{
register char * cp;
char * cp1;
struct zone z;
struct zone z = { 0 };
int format_len;
register int i_stdoff, i_rule, i_format;
register int i_untilyear, i_untilmonth;