Fixed sign-compare warnings

This commit is contained in:
Armin Novak 2019-02-07 14:35:58 +01:00
parent b5a7e4d9b9
commit 309fe960f7
1 changed files with 3 additions and 1 deletions

View File

@ -720,10 +720,12 @@ HRESULT PathCchStripPrefixW(PWSTR pszPath, size_t cchPath)
if (hasPrefix) if (hasPrefix)
{ {
int rc;
if (cchPath < 6) if (cchPath < 6)
return S_FALSE; return S_FALSE;
if (cchPath < (lstrlenW(&pszPath[4]) + 1)) rc = (lstrlenW(&pszPath[4]) + 1);
if ((rc < 0) || ((INT64)cchPath < rc))
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
if (IsCharAlphaW(pszPath[4]) && (pszPath[5] == L':')) /* like C: */ if (IsCharAlphaW(pszPath[4]) && (pszPath[5] == L':')) /* like C: */