Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions tools/aulast/aulast.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ int main(int argc, char *argv[])
file = argv[i];
} else {
fprintf(stderr,"stdin already given\n");
return 1;
goto arg_error;
}
} else if (strcmp(argv[i], "--bad") == 0) {
bad = 1;
Expand All @@ -510,29 +510,29 @@ int main(int argc, char *argv[])
use_stdin = 1;
else {
fprintf(stderr, "file already given\n");
return 1;
goto arg_error;
}
} else if (strcmp(argv[i], "--user") == 0) {
if (user == NULL) {
i++;
user = argv[i];
} else {
usage();
return 1;
goto arg_error;
}
} else if (strcmp(argv[i], "--tty") == 0) {
if (cterm == NULL) {
i++;
cterm = argv[i];
} else {
usage();
return 1;
goto arg_error;
}
} else if (strcmp(argv[i], "--debug") == 0) {
debug = 1;
} else {
usage();
return 1;
goto arg_error;
}
}
list_create(&l);
Expand Down Expand Up @@ -612,6 +612,11 @@ int main(int argc, char *argv[])
fclose(f);
return 0;

arg_error:
if (f)
fclose(f);
return 1;

error_exit_1:
list_clear(&l);
if (f)
Expand Down