Fix invalid C code (undefined behavior).

This commit is contained in:
Francois Gouget 2002-01-21 18:00:05 +00:00 committed by Alexandre Julliard
parent e6ebf42c2b
commit 8aceb00c52
1 changed files with 3 additions and 1 deletions

View File

@ -628,9 +628,11 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
SetUrlComponentValue(&lpUrlComponents->lpszUserName, SetUrlComponentValue(&lpUrlComponents->lpszUserName,
&lpUrlComponents->dwUserNameLength, lpszUser, lpszPasswd - lpszUser); &lpUrlComponents->dwUserNameLength, lpszUser, lpszPasswd - lpszUser);
if (lpszPasswd != lpszHost)
lpszPasswd++;
SetUrlComponentValue(&lpUrlComponents->lpszPassword, SetUrlComponentValue(&lpUrlComponents->lpszPassword,
&lpUrlComponents->dwPasswordLength, &lpUrlComponents->dwPasswordLength,
lpszPasswd == lpszHost ? NULL : ++lpszPasswd, lpszPasswd == lpszHost ? NULL : lpszPasswd,
lpszHost - lpszPasswd); lpszHost - lpszPasswd);
lpszcp++; /* Advance to beginning of host */ lpszcp++; /* Advance to beginning of host */