diff --git a/src/apps/gbasm.c b/src/apps/gbasm.c index 922d6de..1788d10 100644 --- a/src/apps/gbasm.c +++ b/src/apps/gbasm.c @@ -39,7 +39,7 @@ int main(int argc, char **argv) close(out_fd); } - out_fd = open(optarg, O_WRONLY | O_CREAT); + out_fd = open(optarg, O_WRONLY | O_CREAT | O_TRUNC); if (out_fd < 0) { fprintf(stderr, "failed to open output file %s\n", optarg); exit(1);