typecase to fix win32 compiler warning (and intended as other code is)

This commit is contained in:
Daniel Stenberg 2005-03-21 22:37:18 +00:00
parent 8817779f23
commit e19c203728
1 changed files with 11 additions and 12 deletions

View File

@ -147,21 +147,20 @@ static int file_lookup(struct in_addr *addr, struct hostent **host)
int status; int status;
#ifdef WIN32 #ifdef WIN32
char PATH_HOSTS[MAX_PATH]; char PATH_HOSTS[MAX_PATH];
if (IS_NT()) { if (IS_NT()) {
char tmp[MAX_PATH]; char tmp[MAX_PATH];
HKEY hkeyHosts; HKEY hkeyHosts;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts) if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts)
== ERROR_SUCCESS) == ERROR_SUCCESS)
{ {
DWORD dwLength = MAX_PATH; DWORD dwLength = MAX_PATH;
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, tmp, RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
&dwLength); &dwLength);
ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH); ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH);
RegCloseKey(hkeyHosts); RegCloseKey(hkeyHosts);
} }
} }
else else
GetWindowsDirectory(PATH_HOSTS, MAX_PATH); GetWindowsDirectory(PATH_HOSTS, MAX_PATH);