summaryrefslogtreecommitdiff
path: root/ext/win32ole/win32ole.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-23 08:17:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-23 08:17:50 +0000
commit91218a0e9f4306dbeb95c27f1ba5e5dc8e87f411 (patch)
tree8927b7003e437a99c60625c27532f2086755d9aa /ext/win32ole/win32ole.c
parent3134c5eb62155efbab3dd415ecfd22515ed2ddd0 (diff)
win32ole.c: suppress warnings
* ext/win32ole/win32ole.c (ole_excepinfo2msg, ole_wc2vstr): get rid of size_t with rb_enc_str_new() to suppress warnings on x64-mswin32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole.c')
-rw-r--r--ext/win32ole/win32ole.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index ed5d9141c4..1b39f177f5 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -1171,7 +1171,7 @@ ole_excepinfo2msg(EXCEPINFO *pExInfo)
}
error_msg = rb_str_new2(error_code);
if(pSource != NULL) {
- rb_str_cat(error_msg, pSource, strlen(pSource));
+ rb_str_cat2(error_msg, pSource);
}
else {
rb_str_cat(error_msg, "<Unknown>", 9);
@@ -1387,7 +1387,8 @@ static VALUE
ole_wc2vstr(LPWSTR pw, BOOL isfree)
{
char *p = ole_wc2mb(pw);
- VALUE vstr = rb_enc_str_new(p, strlen(p), cWIN32OLE_enc);
+ VALUE vstr = rb_str_new_cstr(p);
+ rb_enc_associate(vstr, cWIN32OLE_enc);
if(isfree)
SysFreeString(pw);
free(p);