summaryrefslogtreecommitdiffstats
path: root/winsup/utils/regtool.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-03-30 08:22:59 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-03-30 08:22:59 +0000
commit51564c783f61f2c218badac70366381b8abb4c4f (patch)
tree4593fdd31c1d10570cbbc02c79eb19ba7526beac /winsup/utils/regtool.cc
parent4f03f6918204ccaadaccd7af3df2e787e7c94d21 (diff)
downloadcygnal-51564c783f61f2c218badac70366381b8abb4c4f.tar.gz
cygnal-51564c783f61f2c218badac70366381b8abb4c4f.tar.bz2
cygnal-51564c783f61f2c218badac70366381b8abb4c4f.zip
* regtool.cc (cmd_set): Avoid a compiler warning.
Diffstat (limited to 'winsup/utils/regtool.cc')
-rw-r--r--winsup/utils/regtool.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc
index 0da7ecad0..b4463f211 100644
--- a/winsup/utils/regtool.cc
+++ b/winsup/utils/regtool.cc
@@ -697,11 +697,13 @@ cmd_set ()
break;
case REG_SZ:
case REG_EXPAND_SZ:
- n = mbstowcs (NULL, a, 0);
- wchar_t w[n + 1];
- mbstowcs (w, a, n + 1);
- rv = RegSetValueExW (key, value, 0, value_type,
- (const BYTE *) w, (n + 1) * sizeof (wchar_t));
+ {
+ n = mbstowcs (NULL, a, 0);
+ wchar_t w[n + 1];
+ mbstowcs (w, a, n + 1);
+ rv = RegSetValueExW (key, value, 0, value_type,
+ (const BYTE *) w, (n + 1) * sizeof (wchar_t));
+ }
break;
case REG_MULTI_SZ:
for (i = 1, max_n = 1; argv[i]; i++)