summaryrefslogtreecommitdiff
path: root/ext/win32ole/win32ole.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 11:56:42 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-08-31 11:56:42 +0000
commit6790891ef083b77faaf9d779463dfa0569a96ae5 (patch)
treeeea89a4ca3ea28c330bd3681f26964023fa8413f /ext/win32ole/win32ole.c
parent5b5e4a6fc1e2829e6a2e1fb41986e951070646c7 (diff)
* ext/Win32API/Win32API.c (Win32API_initialize): use RSTRING_PTR and
RSTRING_LEN. * ext/tk/stubs.c, ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: ditto. * ext/win32ole/win32ole.c (ole_val2olevariantdata): ditto. * lib/mkmf.rb (create_makefile): follow nil.to_s. * win32/resource.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole.c')
-rw-r--r--ext/win32ole/win32ole.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 8778d70305..ef30d92345 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -1069,7 +1069,7 @@ ole_val2olevariantdata(VALUE val, VARTYPE vtype, struct olevariantdata *pvar)
VARIANT var;
if (((vtype & ~VT_BYREF) == (VT_ARRAY | VT_UI1)) && TYPE(val) == T_STRING) {
- long len = RSTRING(val)->len;
+ long len = RSTRING_LEN(val);
char *pdest = NULL;
SAFEARRAY *psa = SafeArrayCreateVector(VT_UI1, 0, len);
if (!psa) {
@@ -1077,7 +1077,7 @@ ole_val2olevariantdata(VALUE val, VARTYPE vtype, struct olevariantdata *pvar)
}
hr = SafeArrayAccessData(psa, (void **)&pdest);
if (SUCCEEDED(hr)) {
- memcpy(pdest, RSTRING(val)->ptr, len);
+ memcpy(pdest, RSTRING_PTR(val), len);
SafeArrayUnaccessData(psa);
V_VT(&(pvar->realvar)) = vtype;
V_ARRAY(&(pvar->realvar)) = psa;