mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
fix
This commit is contained in:
parent
c0e3bbbc61
commit
dde98fc8b6
@ -353,7 +353,6 @@ int verifyChecksumFromFlash(char *mess, char *functionType,
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// read only until a particular size (drive)
|
||||
if (fsize != 0 && totalBytesRead >= fsize) {
|
||||
LOG(logINFO,
|
||||
@ -361,10 +360,11 @@ int verifyChecksumFromFlash(char *mess, char *functionType,
|
||||
break;
|
||||
}
|
||||
// for less than 128 bytes
|
||||
ssize_t bytesToRead = readUnitSize;
|
||||
if ((readUnitSize + totalBytesRead) > fsize) {
|
||||
readUnitSize = fsize - totalBytesRead;
|
||||
bytesToRead = fsize - totalBytesRead;
|
||||
}
|
||||
bytes = fread(buf, 1, readUnitSize, fp);
|
||||
bytes = fread(buf, 1, bytesToRead, fp);
|
||||
totalBytesRead += bytes;
|
||||
}
|
||||
LOG(logINFO, ("\tRead %lu bytes to calculate checksum\n", totalBytesRead));
|
||||
|
Loading…
x
Reference in New Issue
Block a user