From e919d4d05ac2f9749c77e6a34ebcb9c22df316fc Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 24 Oct 2018 00:54:52 +0200 Subject: [PATCH] Remove getFileContain function's limitation. --- PowerEditor/src/MISC/Common/Common.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index b7e8f3aa..7912b0bc 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -74,13 +74,7 @@ std::string getFileContent(const TCHAR *file2read) { lenFile = fread(data, 1, blockSize - 1, fp); if (lenFile <= 0) break; - - if (lenFile >= blockSize - 1) - data[blockSize - 1] = '\0'; - else - data[lenFile] = '\0'; - - wholeFileContent += data; + wholeFileContent.append(data, lenFile); } while (lenFile > 0); @@ -88,7 +82,6 @@ std::string getFileContent(const TCHAR *file2read) return wholeFileContent; } - char getDriveLetter() { char drive = '\0';