After entering a case on iEncoding for ANSI/UTF, iEncoding can only have those two values. Fixes Coverity CIDS 19, 20.

svn path=/trunk/; revision=36617
This commit is contained in:
Gregor Schneider 2008-10-01 19:56:51 +00:00
parent 0d10840784
commit b95a85f898

View file

@ -120,8 +120,6 @@ BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding
iCodePage = CP_ACP;
else if (iEncoding == ENCODING_UTF8)
iCodePage = CP_UTF8;
else
goto done;
if ((dwSize - dwPos) > 0)
{
@ -263,8 +261,6 @@ static BOOL WriteEncodedText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, int
iCodePage = CP_ACP;
else if (iEncoding == ENCODING_UTF8)
iCodePage = CP_UTF8;
else
goto done;
iRequiredBytes = WideCharToMultiByte(iCodePage, 0, &pszText[dwPos], dwTextLen - dwPos, NULL, 0, NULL, NULL);
if (iRequiredBytes <= 0)