diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-10-18 10:24:37 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-10-18 10:25:16 -0700 |
commit | b0ac02e82a6a1ef9d6285bbb8bef917d4736ac9b (patch) | |
tree | 19ed99739138d47398a68d4ef8dcafac2cf82ead /lib/time_rz.c | |
parent | 04dee58e17db70e8d0396166be00e6a1b38c31d7 (diff) | |
download | gnulib-b0ac02e82a6a1ef9d6285bbb8bef917d4736ac9b.tar.gz |
time_rz: return NULL if localtime_r fails
* lib/time_rz.c (localtime_rz): Return NULL if localtime_r fails,
while still attempting to pacify bleeding-edge GCC.
Diffstat (limited to 'lib/time_rz.c')
-rw-r--r-- | lib/time_rz.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/time_rz.c b/lib/time_rz.c index 396cdd2020..8a0cbb207d 100644 --- a/lib/time_rz.c +++ b/lib/time_rz.c @@ -288,9 +288,8 @@ localtime_rz (timezone_t tz, time_t const *t, struct tm *tm) timezone_t old_tz = set_tz (tz); if (old_tz) { - if (localtime_r (t, tm) && !save_abbr (tz, tm)) - tm = NULL; - if (revert_tz (old_tz)) + bool abbr_saved = localtime_r (t, tm) && save_abbr (tz, tm); + if (revert_tz (old_tz) && abbr_saved) return tm; } return NULL; |