diff --git a/src/uxnasm.c b/src/uxnasm.c index 22f5fce..1e7894e 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -435,6 +435,8 @@ main(int argc, char *argv[]) return !error("Assembly", "Failed to assemble rom."); if(!(dst = fopen(argv[2], "wb"))) return !error("Invalid Output", argv[2]); + if(p.length <= TRIM) + return !error("Assembly", "Output rom is empty."); fwrite(p.data + TRIM, p.length - TRIM, 1, dst); review(argv[2]); return 0;