From 9f66faa3749e3919726828199b25a9b3b6b30e96 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 22 Jul 2009 15:09:50 +0000 Subject: [PATCH] * time.c (init_leap_second_info): checks the result of gmtime to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ time.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4c80cd2117..a4e949666d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 23 00:10:02 2009 Nobuyoshi Nakada + + * time.c (init_leap_second_info): checks the result of gmtime to + suppress warnings. + Wed Jul 22 22:23:24 2009 Yusuke Endoh * vm_core.h (struct rb_iseq_t): add a new field line_no. This field diff --git a/time.c b/time.c index 74f1f28555..ef9f529d15 100644 --- a/time.c +++ b/time.c @@ -522,6 +522,7 @@ init_leap_second_info() now = time(NULL); gmtime(&now); tm = gmtime_with_leapsecond(&now, &result); + if (!tm) return; this_year = tm->tm_year; max = ~(time_t)0;