ical: fix gcc 4.4 warning

gcc 4.4 complains about "num_types" being used potentially uninitialized.
This probably refers to bailing out before num_types gets set. However,
the use is conditional on "types", which is only set after "num_types",
so this is a false warning.

Prevent the warning anyway for the sake of clean -Wall -Werror compilation.
This commit is contained in:
Patrick Ohly 2014-03-20 06:12:53 -07:00
parent fd0d1582f7
commit 8d84ef1ab4

View file

@ -320,7 +320,7 @@ icaltzutil_fetch_timezone (const char *location)
int ret = 0;
FILE *f;
tzinfo type_cnts;
unsigned int i, num_trans, num_types, num_chars, num_leaps, num_isstd, num_isgmt;
unsigned int i, num_trans, num_types = 0, num_chars, num_leaps, num_isstd, num_isgmt;
time_t *transitions = NULL;
time_t trans;
int *trans_idx = NULL, dstidx = -1, stdidx = -1, pos, sign, zidx, zp_idx;