This commit is contained in:
maliakal_d 2021-09-08 21:07:25 +02:00
parent 03823cf903
commit 8647717fec

View File

@ -230,7 +230,7 @@ int writeToFlash(FILE *flashfd, FILE *srcfd, char *mess) {
if (buffer == NULL) {
fclose(flashfd);
fclose(srcfd);
strcpy(mess, "Could not program foga. Memory allocation to write to "
strcpy(mess, "Could not program fpga. Memory allocation to write to "
"flash failed.\n");
LOG(logERROR, (mess));
return FAIL;
@ -243,6 +243,7 @@ int writeToFlash(FILE *flashfd, FILE *srcfd, char *mess) {
fwrite((void *)buffer, sizeof(char), bytes, flashfd);
totalBytes += bytesWritten;
if (bytesWritten != bytes) {
free(buffer);
fclose(flashfd);
fclose(srcfd);
sprintf(mess,
@ -257,6 +258,7 @@ int writeToFlash(FILE *flashfd, FILE *srcfd, char *mess) {
printf(".");
}
printf("\n");
free(buffer);
fclose(flashfd);
fclose(srcfd);
LOG(logINFO, ("\tWrote %ld bytes to flash\n", totalBytes));