diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2023-09-05 12:13:10 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2023-09-12 16:33:27 +0200 |
commit | a86fb92d4bc1a64703cabf351035efc861ea54dd (patch) | |
tree | 73182b5d55797c69bb809bf02797396f73621564 /src/tools | |
parent | e9ca247479206b3d6f3815c599a244d9bfbae394 (diff) |
syncqt: Add the missing is_open check to writeIfDifferent
Pick-to: 6.5 6.6
Change-Id: I2a969483d20f250083c1a262bd3bfc696a7f0df4
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/syncqt/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/syncqt/main.cpp b/src/tools/syncqt/main.cpp index 2d4d997ae0..b9be6378dd 100644 --- a/src/tools/syncqt/main.cpp +++ b/src/tools/syncqt/main.cpp @@ -1780,6 +1780,10 @@ bool SyncScanner::writeIfDifferent(const std::string &outputFile, const std::str memset(rdBuffer, 0, bufferSize); std::ifstream ifs(outputFile, std::fstream::in); + if (!ifs.is_open()) { + std::cerr << "Unable to open " << outputFile << " for comparison." << std::endl; + return false; + } std::streamsize currentPos = 0; std::size_t bytesRead = 0; |