diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/win32ole/win32ole.c | 6 |
2 files changed, 7 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Sun Jun 29 07:53:08 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp> + + * ext/win32ole/win32ole.c (date2time_str): fix the overflow in + some situation. [ruby-bugs-20793] + Sat Jun 28 21:25:08 2008 Tanaka Akira <akr@fsij.org> * include/ruby/ruby.h (struct RRegexp): new field usecnt. replace diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 17d61a776..7fd918140 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -116,7 +116,7 @@ #define WC2VSTR(x) ole_wc2vstr((x), TRUE) -#define WIN32OLE_VERSION "1.1.6" +#define WIN32OLE_VERSION "1.1.7" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); @@ -768,12 +768,10 @@ static VALUE date2time_str(double date) { int y, m, d, hh, mm, ss; - char szTime[20]; double2time(date, &y, &m, &d, &hh, &mm, &ss); - sprintf(szTime, + return rb_sprintf( "%04d/%02d/%02d %02d:%02d:%02d", y, m, d, hh, mm, ss); - return rb_str_new2(szTime); } #define ENC_MACHING_CP(enc,encname,cp) if(strcasecmp(rb_enc_name((enc)),(encname)) == 0) return cp |