Remove getFileContain function's limitation.

This commit is contained in:
Don HO 2018-10-24 00:54:52 +02:00
parent ec340000cc
commit e919d4d05a
1 changed files with 1 additions and 8 deletions

View File

@ -74,13 +74,7 @@ std::string getFileContent(const TCHAR *file2read)
{ {
lenFile = fread(data, 1, blockSize - 1, fp); lenFile = fread(data, 1, blockSize - 1, fp);
if (lenFile <= 0) break; if (lenFile <= 0) break;
wholeFileContent.append(data, lenFile);
if (lenFile >= blockSize - 1)
data[blockSize - 1] = '\0';
else
data[lenFile] = '\0';
wholeFileContent += data;
} }
while (lenFile > 0); while (lenFile > 0);
@ -88,7 +82,6 @@ std::string getFileContent(const TCHAR *file2read)
return wholeFileContent; return wholeFileContent;
} }
char getDriveLetter() char getDriveLetter()
{ {
char drive = '\0'; char drive = '\0';