Skip to content

Commit

Permalink
Merge pull request #585 from F0bes/bin2c-warning-fix
Browse files Browse the repository at this point in the history
Fix unused variable warning
  • Loading branch information
fjtrujy authored Mar 27, 2024
2 parents 92cff0a + 921cf07 commit 1514cc6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/bin2c/src/bin2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ int main(int argc, char *argv[])
size_t dst_total_size = size_prologue + size_epilogue + (src_stat.st_size * 6) + (src_stat.st_size / 16 * 2) + ((src_stat.st_size % 16) ? 2 : 0);

lseek(dst_fd, dst_total_size - 1, SEEK_SET);
write(dst_fd, "", 1);
if(write(dst_fd, "", 1) == -1)
{
printf("Failed to write to output file.\n");
close(dst_fd);
close(src_fd);
return 1;
}

lseek(dst_fd, 0, SEEK_SET);

#ifdef USE_MMAP
Expand All @@ -108,6 +115,7 @@ int main(int argc, char *argv[])
{
printf("Failed to map output file.\n");
close(dst_fd);
close(src_fd);
return 1;
}

Expand Down

0 comments on commit 1514cc6

Please sign in to comment.