aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_asn1.c
diff options
context:
space:
mode:
authorrhe <rhe@ruby-lang.org>2016-05-30 13:02:13 +0000
committerKazuki Yamaguchi <k@rhe.jp>2016-05-31 11:31:27 +0900
commit96707e91668d7b17aa222e8beb6f925c4b3a77f3 (patch)
tree6746fcd8f7b4ed06ab64d3a31720b429790929e8 /ext/openssl/ossl_asn1.c
parentfcb9b4a6b5c6e30a99d9acb8c73e62c3c7559001 (diff)
downloadruby-openssl-96707e91668d7b17aa222e8beb6f925c4b3a77f3.tar.gz
openssl: use NUM2TIMET() to convert Integer to time_t
* ext/openssl/ossl_asn1.c (time_to_time_t): Use NUM2TIMET() instead of NUM2LONG(). time_t may be larger than long. [ruby-core:45552] [Bug #6571] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_asn1.c')
-rw-r--r--ext/openssl/ossl_asn1.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index e77adbf9..43a3d2d8 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -75,15 +75,10 @@ asn1time_to_time(ASN1_TIME *time)
return rb_funcall2(rb_cTime, rb_intern("utc"), 6, argv);
}
-/*
- * This function is not exported in Ruby's *.h
- */
-extern struct timeval rb_time_timeval(VALUE);
-
time_t
time_to_time_t(VALUE time)
{
- return (time_t)NUM2LONG(rb_Integer(time));
+ return (time_t)NUM2TIMET(rb_Integer(time));
}
/*