summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHarold L Hunt II <huntharo@msu.edu>2004-03-09 00:24:08 +0000
committerHarold L Hunt II <huntharo@msu.edu>2004-03-09 00:24:08 +0000
commit83e4b9523420fe28f5b28db9fd4fbdc84d660d51 (patch)
tree9531261fa5866681a05abd3b54c107594c5100e4 /hw
parent4dc5c1f109c69141ee410f9aa641430717cde862 (diff)
Fix crash on startup, build warning, and close an opened registry key.
Diffstat (limited to 'hw')
-rw-r--r--hw/xwin/winconfig.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
index c6c8b8f32..6b4056af1 100644
--- a/hw/xwin/winconfig.c
+++ b/hw/xwin/winconfig.c
@@ -354,12 +354,12 @@ winConfigKeyboard (DeviceIntPtr pDevice)
if (!bfound)
{
- HKEY regkey;
- const char regtempl =
+ HKEY regkey = NULL;
+ const char regtempl[] =
"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\";
char *regpath;
char lname[256];
- unsigned short namesize = sizeof(lname);
+ DWORD namesize = sizeof(lname);
regpath = alloca(sizeof(regtempl) + KL_NAMELENGTH + 1);
strcpy(regpath, regtempl);
@@ -371,6 +371,10 @@ winConfigKeyboard (DeviceIntPtr pDevice)
winMsg (X_ERROR,
"Keyboardlayout \"%s\" (%s) is unknown\n", lname, layoutName);
}
+
+ /* Close registry key */
+ if (regkey)
+ RegCloseKey (regkey);
}
}