Skip to content

Commit

Permalink
fix segfault when no argument is given.
Browse files Browse the repository at this point in the history
  • Loading branch information
aoymt committed Aug 25, 2022
1 parent 9296776 commit 1f979cb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/dry.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,23 @@ along with this program. If not, see http://www.gnu.org/licenses/.

void StdFace_main(char *fname);

void usage(const char *prog)
{
printf("usage: %s stan.in\n", prog);
}

int main(int argc, char *argv[])
{
if (strcmp(argv[1], "-v") == 0) {
if (argc < 2) {
printVersion();
usage(argv[0]);
exit(0);
}
else {
} else if (strcmp(argv[1], "-v") == 0) {
printVersion();
exit(0);
} else {
StdFace_main(argv[1]);
}

return 0;
}

0 comments on commit 1f979cb

Please sign in to comment.