Eolite 3.77: fix system hand when try to copy file size bigger than RAM available

git-svn-id: svn://kolibrios.org@6979 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2017-09-17 01:55:51 +00:00
parent ad6c634152
commit 9e8243ee10
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager v3.76" #define TITLE "Eolite File Manager v3.77"
#define ABOUT_TITLE "EOLITE 3.76" #define ABOUT_TITLE "EOLITE 3.77"
#ifdef LANG_RUS #ifdef LANG_RUS
?define T_FILE "” ©«" ?define T_FILE "” ©«"

View File

@ -41,8 +41,12 @@
{ {
debugln("Error: CopyFile->GetFileInfo"); debugln("Error: CopyFile->GetFileInfo");
} }
else else if (GetFreeRAM() < CopyFile_atr.sizelo)
{ {
debugln("Error: CopyFile->File size is bigger than RAM avilable");
error = 30;
}
else {
cbuf = malloc(CopyFile_atr.sizelo); cbuf = malloc(CopyFile_atr.sizelo);
if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3)) if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3))
{ {