summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 14:02:55 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-17 14:02:55 +0000
commit776c8182f0aad54c6efaa8cb868b16a912ca232d (patch)
tree89578c5cdc540fe3871a54efbb5f11285981c779 /ext
parent65f49d2dcfad3eb436889f724808f30baa943098 (diff)
merge revision(s) 51575,51584: [Backport #11439]
* ext/win32/lib/win32/registry.rb (API#SetValue): add terminator size, not 1 byte. [ruby-core:70365] [Bug #11439] * ext/win32/lib/win32/registry.rb (API#SetValue): data size should be in bytes, not in chars. [ruby-core:70365] [Bug #11439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@51618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/win32/lib/win32/registry.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb
index f0166d69b9..b17c85c2f1 100644
--- a/ext/win32/lib/win32/registry.rb
+++ b/ext/win32/lib/win32/registry.rb
@@ -326,7 +326,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
case type
when REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ
data = data.encode(WCHAR)
- size ||= data.size + 1
+ size ||= data.bytesize + WCHAR_SIZE
end
check RegSetValueExW.call(hkey, make_wstr(name), 0, type, data, size)
end