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