diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 03b15b54c..bde20c3c1 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1279,6 +1279,9 @@ std::vector DetectorImpl::readProgrammingFile(const std::string &fname) { "Program FPGA: Could not open source file for programming: " + fname); } + if (fseek(src, 0, SEEK_END) != 0) { + throw RuntimeError("Program FPGA: Seek error in src file"); + } size_t srcSize = ftell(src); if (srcSize <= 0) { throw RuntimeError("Program FPGA: Could not get length of source file");