Commit 8826ba1b authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

kernel32: Return proper char count in get_registry_locale_info.

parent 46d06eb4
...@@ -1206,7 +1206,9 @@ static INT get_registry_locale_info( struct registry_value *registry_value, LPWS ...@@ -1206,7 +1206,9 @@ static INT get_registry_locale_info( struct registry_value *registry_value, LPWS
{ {
if (status == STATUS_BUFFER_OVERFLOW && !buffer) if (status == STATUS_BUFFER_OVERFLOW && !buffer)
{ {
ret = (size - info_size) / sizeof(WCHAR) + 1; ret = (size - info_size) / sizeof(WCHAR);
if (!ret || ((WCHAR *)&info->Data)[ret-1])
ret++;
} }
else if (status == STATUS_OBJECT_NAME_NOT_FOUND) else if (status == STATUS_OBJECT_NAME_NOT_FOUND)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment