Skip to content

Commit b31055a

Browse files
authored
Oopsie whoopsies
ya gotta exit after `-h` and `-v` cus otherwise you're tryna stare at the sun
1 parent fe125a5 commit b31055a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ int main(int argc, char **argv) {
7373

7474
if (argc != 2) { error("nex", "expects a filename as input"); }
7575
if (argv[1][0] == '-') {
76-
if (argv[1][1] == 'v') { ok("nex", version "\n"); }
77-
if (argv[1][1] == 'h') { ok("nex", "\n nex (filename) opens and edits a file in hex"); }
76+
if (argv[1][1] == 'v') { ok("nex", version "\n"); exit(0); }
77+
if (argv[1][1] == 'h') { ok("nex", "\n nex (filename) opens and edits a file in hex"); exit(0); }
7878
}
7979
char *filename = argv[1];
8080
buffer = malloc(sizeof(char)*initsize); buffersize = initsize;

0 commit comments

Comments
 (0)