[winpr,file] Fix assert fail always when removing flags

This commit is contained in:
lazy5f
2025-04-29 07:58:34 +09:00
parent 9bd2330c4e
commit 05326f15b6

View File

@@ -985,7 +985,7 @@ static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dw
if (fstat(fileno(pFile->fp), &st) == 0 && dwFlagsAndAttributes & FILE_ATTRIBUTE_READONLY)
{
st.st_mode &= WINPR_ASSERTING_INT_CAST(mode_t, ~(S_IWUSR | S_IWGRP | S_IWOTH));
st.st_mode &= WINPR_ASSERTING_INT_CAST(mode_t, (mode_t)(~(S_IWUSR | S_IWGRP | S_IWOTH)));
fchmod(fileno(pFile->fp), st.st_mode);
}