Skip to content

Commit

Permalink
Merge pull request #17 from aoymt/feature/fix_noarg
Browse files Browse the repository at this point in the history
fix segfault when no argument is given.
  • Loading branch information
k-yoshimi authored Nov 19, 2022
2 parents bd97579 + 1f979cb commit 2cd7e12
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 2cd7e12

Please sign in to comment.