diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-03-21 22:37:18 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-03-21 22:37:18 +0000 |
commit | e19c2037282b239494c763d1ee46eb92df89903a (patch) | |
tree | 42392ff9a577f2c728b0510aed509e3361c0c00b /ares | |
parent | 8817779f239844a2215b5f1eb7877f0dccd0f857 (diff) |
typecase to fix win32 compiler warning (and intended as other code is)
Diffstat (limited to 'ares')
-rw-r--r-- | ares/ares_gethostbyaddr.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/ares/ares_gethostbyaddr.c b/ares/ares_gethostbyaddr.c index b33086c01..265b89d24 100644 --- a/ares/ares_gethostbyaddr.c +++ b/ares/ares_gethostbyaddr.c @@ -147,21 +147,20 @@ static int file_lookup(struct in_addr *addr, struct hostent **host) int status; #ifdef WIN32 - char PATH_HOSTS[MAX_PATH]; if (IS_NT()) { - char tmp[MAX_PATH]; - HKEY hkeyHosts; + char tmp[MAX_PATH]; + HKEY hkeyHosts; - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) - == ERROR_SUCCESS) - { - DWORD dwLength = MAX_PATH; - RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, tmp, - &dwLength); - ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH); - RegCloseKey(hkeyHosts); - } + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) + == ERROR_SUCCESS) + { + DWORD dwLength = MAX_PATH; + RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, + &dwLength); + ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH); + RegCloseKey(hkeyHosts); + } } else GetWindowsDirectory(PATH_HOSTS, MAX_PATH); |