Skip to content

Commit 61caeb2

Browse files
committed
Fix compiler warning.
1 parent 046ee2d commit 61caeb2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ftx/xfer.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,12 @@ static int DoUpload(const char *pFilename, const unsigned int address)
384384
}
385385
else
386386
{
387-
fread(pFileBuffer, 1, size, File);
387+
if (fread(pFileBuffer, 1, size, File) != size)
388+
{
389+
printf("File read error\n");
390+
goto UploadError;
391+
}
392+
388393
checksum = crc_update(checksum, pFileBuffer, size);
389394
checksum = crc_finalize(checksum);
390395

0 commit comments

Comments
 (0)