(uxnasm) Fixed crashing but on no-output

This commit is contained in:
Devine Lu Linvega 2024-02-25 17:37:03 -08:00
parent 9f1df5f944
commit 7fc1b0887f
1 changed files with 1 additions and 3 deletions

View File

@ -520,9 +520,7 @@ main(int argc, char *argv[])
return !error("Invalid input", argv[1]); return !error("Invalid input", argv[1]);
if(!assemble(src)) if(!assemble(src))
return !error("Assembly", "Failed to assemble rom."); return !error("Assembly", "Failed to assemble rom.");
if(scmp(argv[2], "-", 2)) if(!(dst = fopen(argv[2], "wb")))
dst = stdout;
else if(!(dst = fopen(argv[2], "wb")))
return !error("Invalid Output", argv[2]); return !error("Invalid Output", argv[2]);
if(p.length <= TRIM) if(p.length <= TRIM)
return !error("Assembly", "Output rom is empty."); return !error("Assembly", "Output rom is empty.");