[NOTEPAD] Don't leave junk behind when opening smaller file (#7227)

This commit is contained in:
Whindmar Saksit 2024-08-10 17:08:00 +02:00 committed by GitHub
parent 81ec056963
commit e546525eac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,6 +343,7 @@ VOID DoOpenFile(LPCTSTR szFileName)
return;
WaitCursor(TRUE);
SetWindowText(Globals.hEdit, NULL);
hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);