diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 14:27:58 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 14:27:58 +0000 |
commit | 911ade36df679fbc816456d5d58b5fc8fb1e0db4 (patch) | |
tree | 16d157cea288361b903dac7a0a1938c1cf0a01bf /ext | |
parent | 26eb8e4b4e39aee7c1e4e9c061c9c17daaafc78b (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_1@51620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/win32/lib/win32/registry.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb index d1cc06e970..911821a1b3 100644 --- a/ext/win32/lib/win32/registry.rb +++ b/ext/win32/lib/win32/registry.rb @@ -315,7 +315,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 |