* regtool.cc (cmd_set): Avoid a compiler warning.

This commit is contained in:
Corinna Vinschen 2011-03-30 08:22:59 +00:00
parent 4f03f69182
commit 51564c783f
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2011-02-29 Corinna Vinschen <corinna@vinschen.de>
* regtool.cc (cmd_set): Avoid a compiler warning.
2011-02-29 Corinna Vinschen <corinna@vinschen.de> 2011-02-29 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (handle_unique_object_name): Avoid a compiler warning. * cygcheck.cc (handle_unique_object_name): Avoid a compiler warning.

View File

@ -697,11 +697,13 @@ cmd_set ()
break; break;
case REG_SZ: case REG_SZ:
case REG_EXPAND_SZ: case REG_EXPAND_SZ:
{
n = mbstowcs (NULL, a, 0); n = mbstowcs (NULL, a, 0);
wchar_t w[n + 1]; wchar_t w[n + 1];
mbstowcs (w, a, n + 1); mbstowcs (w, a, n + 1);
rv = RegSetValueExW (key, value, 0, value_type, rv = RegSetValueExW (key, value, 0, value_type,
(const BYTE *) w, (n + 1) * sizeof (wchar_t)); (const BYTE *) w, (n + 1) * sizeof (wchar_t));
}
break; break;
case REG_MULTI_SZ: case REG_MULTI_SZ:
for (i = 1, max_n = 1; argv[i]; i++) for (i = 1, max_n = 1; argv[i]; i++)