summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-10 22:37:40 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-10 22:37:40 +0000
commit6670aee9793b2fb57ecfe0c89111bc08bed79d14 (patch)
tree22eae6da826b8336299adf9849fc6b4324331bb6 /time.c
parentfce17c541a36d5e7b91fe7afb26b63f7ea6e232a (diff)
* time.c (find_time_t): test the result of LOCALTIME.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/time.c b/time.c
index 0363532924..75f1355286 100644
--- a/time.c
+++ b/time.c
@@ -2870,7 +2870,7 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp)
guess2 += 24 * 60 * 60;
if (guess != guess2) {
tm = LOCALTIME(&guess2, result);
- if (tmcmp(tptr, tm) == 0) {
+ if (tm && tmcmp(tptr, tm) == 0) {
if (guess < guess2)
*tp = guess;
else
@@ -2895,7 +2895,7 @@ find_time_t(struct tm *tptr, int utc_p, time_t *tp)
guess2 -= 24 * 60 * 60;
if (guess != guess2) {
tm = LOCALTIME(&guess2, result);
- if (tmcmp(tptr, tm) == 0) {
+ if (tm && tmcmp(tptr, tm) == 0) {
if (guess < guess2)
*tp = guess2;
else