Jacek Caban : wininet: Don' t strip port part from server name in GetAddress.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Feb 16 10:01:20 CST 2015
Module: wine
Branch: master
Commit: 11d09f1fe7be3b418ffc669bb60b79049f90d6b9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=11d09f1fe7be3b418ffc669bb60b79049f90d6b9
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Feb 16 11:16:16 2015 +0100
wininet: Don't strip port part from server name in GetAddress.
Callers take care of that already.
---
dlls/wininet/utility.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/dlls/wininet/utility.c b/dlls/wininet/utility.c
index 871db1b..ec82779 100644
--- a/dlls/wininet/utility.c
+++ b/dlls/wininet/utility.c
@@ -129,27 +129,15 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
struct sockaddr *psa, socklen_t *sa_len)
{
struct addrinfo *res, hints;
- WCHAR *found;
char *name;
- int len, sz;
+ int sz;
int ret;
TRACE("%s\n", debugstr_w(lpszServerName));
- /* Validate server name first
- * Check if there is something like
- * pinger.macromedia.com:80
- * if yes, eliminate the :80....
- */
- found = strchrW(lpszServerName, ':');
- if (found)
- len = found - lpszServerName;
- else
- len = strlenW(lpszServerName);
-
- sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, NULL, 0, NULL, NULL );
+ sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, -1, NULL, 0, NULL, NULL );
if (!(name = heap_alloc(sz + 1))) return FALSE;
- WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL );
+ WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, -1, name, sz, NULL, NULL );
name[sz] = 0;
memset( &hints, 0, sizeof(hints) );
More information about the wine-cvs
mailing list