mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 03:02:06 +00:00
Replace fprintf by errx for consistency
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -77,8 +77,7 @@ main(int argc, char *argv[])
|
|||||||
errx(1, "Invalid argument for option 'p'");
|
errx(1, "Invalid argument for option 'p'");
|
||||||
}
|
}
|
||||||
if (fillchar < 0 || fillchar > 0xFF) {
|
if (fillchar < 0 || fillchar > 0xFF) {
|
||||||
fprintf(stderr, "Argument for option 'p' must be between 0 and 0xFF");
|
errx(1, "Argument for option 'p' must be between 0 and 0xFF");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
|
|||||||
@@ -111,18 +111,15 @@ Output(void)
|
|||||||
if (tzOverlayname) {
|
if (tzOverlayname) {
|
||||||
f_overlay = fopen(tzOverlayname, "rb");
|
f_overlay = fopen(tzOverlayname, "rb");
|
||||||
if (!f_overlay) {
|
if (!f_overlay) {
|
||||||
fprintf(stderr, "Failed to open overlay file %s\n", tzOverlayname);
|
errx(1, "Failed to open overlay file %s\n", tzOverlayname);
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
fseek(f_overlay, 0, SEEK_END);
|
fseek(f_overlay, 0, SEEK_END);
|
||||||
if (ftell(f_overlay) % 0x4000 != 0) {
|
if (ftell(f_overlay) % 0x4000 != 0) {
|
||||||
fprintf(stderr, "Overlay file must be aligned to 0x4000 bytes\n");
|
errx(1, "Overlay file must be aligned to 0x4000 bytes\n");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
MaxOverlayBank = (ftell(f_overlay) / 0x4000) - 1;
|
MaxOverlayBank = (ftell(f_overlay) / 0x4000) - 1;
|
||||||
if (MaxOverlayBank < 1) {
|
if (MaxOverlayBank < 1) {
|
||||||
fprintf(stderr, "Overlay file be at least 0x8000 bytes\n");
|
errx(1, "Overlay file must be at least 0x8000 bytes\n");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
if (MaxOverlayBank > MaxBankUsed) {
|
if (MaxOverlayBank > MaxBankUsed) {
|
||||||
MaxBankUsed = MaxOverlayBank;
|
MaxBankUsed = MaxOverlayBank;
|
||||||
|
|||||||
Reference in New Issue
Block a user