diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-28 23:00:58 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-28 23:00:58 +0000 |
commit | e47ebfe5187a19a1d379b97810cd8684de8cc339 (patch) | |
tree | 996b5ce770843d517a6bb18d6c2b2fd7426cbfb3 /ext/win32ole/win32ole.c | |
parent | 214bb567f2c0a1ec370b0866bf52ce286586d6cd (diff) | |
download | ruby-e47ebfe5187a19a1d379b97810cd8684de8cc339.tar.gz |
* ext/win32ole/win32ole.c (date2time_str): fix the overflow in
some situation. [ruby-bugs-20793]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole.c')
-rw-r--r-- | ext/win32ole/win32ole.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 17d61a7769..7fd9181405 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 |