diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 14:02:55 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-08-17 14:02:55 +0000 |
commit | 776c8182f0aad54c6efaa8cb868b16a912ca232d (patch) | |
tree | 89578c5cdc540fe3871a54efbb5f11285981c779 /ext | |
parent | 65f49d2dcfad3eb436889f724808f30baa943098 (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.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 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 |