incorrect check for fwrite fail (#541)

This commit is contained in:
Dhanya Thattil
2022-08-31 15:53:24 +02:00
committed by GitHub
parent d73d8994c0
commit 4913c9c0b0
2 changed files with 5 additions and 9 deletions

View File

@ -103,13 +103,10 @@ void BinaryDataFile::WriteToFile(char *imageData, sls_receiver_header &header,
}
// if write error
if (ret != imageSize + sizeof(sls_receiver_header)) {
throw RuntimeError(
std::to_string(index) +
" : Write to file failed for image number " +
std::to_string(currentFrameNumber) + ". Wrote " +
std::to_string(ret) + " bytes instead of " +
std::to_string(imageSize + sizeof(sls_receiver_header)));
if (ret != 1) {
throw RuntimeError(std::to_string(index) +
" : Write to file failed for image number " +
std::to_string(currentFrameNumber));
}
}