Skip to content

Commit

Permalink
Replace fprintf by errx for consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
  • Loading branch information
AntonioND committed Aug 21, 2017
1 parent 0c71f5a commit f3b4754
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/link/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ main(int argc, char *argv[])
errx(1, "Invalid argument for option 'p'");
}
if (fillchar < 0 || fillchar > 0xFF) {
fprintf(stderr, "Argument for option 'p' must be between 0 and 0xFF");
exit(1);
errx(1, "Argument for option 'p' must be between 0 and 0xFF");
}
break;
case 's':
Expand Down
9 changes: 3 additions & 6 deletions src/link/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,15 @@ Output(void)
if (tzOverlayname) {
f_overlay = fopen(tzOverlayname, "rb");
if (!f_overlay) {
fprintf(stderr, "Failed to open overlay file %s\n", tzOverlayname);
exit(1);
errx(1, "Failed to open overlay file %s\n", tzOverlayname);
}
fseek(f_overlay, 0, SEEK_END);
if (ftell(f_overlay) % 0x4000 != 0) {
fprintf(stderr, "Overlay file must be aligned to 0x4000 bytes\n");
exit(1);
errx(1, "Overlay file must be aligned to 0x4000 bytes\n");
}
MaxOverlayBank = (ftell(f_overlay) / 0x4000) - 1;
if (MaxOverlayBank < 1) {
fprintf(stderr, "Overlay file be at least 0x8000 bytes\n");
exit(1);
errx(1, "Overlay file must be at least 0x8000 bytes\n");
}
if (MaxOverlayBank > MaxBankUsed) {
MaxBankUsed = MaxOverlayBank;
Expand Down

0 comments on commit f3b4754

Please sign in to comment.