summaryrefslogtreecommitdiff
path: root/ares_gethostbyaddr.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-03-21 22:37:18 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-03-21 22:37:18 +0000
commit6010f4503c28dd45fd3dde7d173e5323817d934a (patch)
tree39046ae78320d5aa0c98ff29bd41048a91ded8e2 /ares_gethostbyaddr.c
parent9d89bc0179f0ff084419dc743a97da8b0e1b1d2d (diff)
downloadc-ares-6010f4503c28dd45fd3dde7d173e5323817d934a.tar.gz
c-ares-6010f4503c28dd45fd3dde7d173e5323817d934a.tar.bz2
c-ares-6010f4503c28dd45fd3dde7d173e5323817d934a.zip
typecase to fix win32 compiler warning (and intended as other code is)
Diffstat (limited to 'ares_gethostbyaddr.c')
-rw-r--r--ares_gethostbyaddr.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/ares_gethostbyaddr.c b/ares_gethostbyaddr.c
index b33086c..265b89d 100644
--- a/ares_gethostbyaddr.c
+++ b/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);