Fixed issue with no-output

This commit is contained in:
Devine Lu Linvega 2024-02-25 17:36:33 -08:00
parent c7ef5230b4
commit c7d3a410ab
2 changed files with 2 additions and 4 deletions

View File

@ -17,7 +17,7 @@ test: bin/uxnasm bin/uxncli bin/uxn11
@ ./bin/uxnasm -v && ./bin/uxncli -v && ./bin/uxn11 -v @ ./bin/uxnasm -v && ./bin/uxncli -v && ./bin/uxn11 -v
@ ./bin/uxnasm etc/opctest.tal bin/opctest.rom @ ./bin/uxnasm etc/opctest.tal bin/opctest.rom
@ ./bin/uxncli bin/opctest.rom @ ./bin/uxncli bin/opctest.rom
install: bin/uxnasm bin/uxncli bin/uxn11 install: all bin/uxnasm bin/uxncli bin/uxn11
@ cp bin/uxn11 bin/uxnasm bin/uxncli ~/bin/ @ cp bin/uxn11 bin/uxnasm bin/uxncli ~/bin/
uninstall: uninstall:
@ rm -f ~/bin/uxn11 ~/bin/uxnasm ~/bin/uxncli @ rm -f ~/bin/uxn11 ~/bin/uxnasm ~/bin/uxncli

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.");