Skip to content

Commit

Permalink
Handle error for ./lisp (main.c).
Browse files Browse the repository at this point in the history
  • Loading branch information
tadd committed Jul 21, 2024
1 parent 8f13503 commit cb54fa2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ static FILE *parse_opt(int argc, char *const *argv)
int main(int argc, char **argv)
{
FILE *in = parse_opt(argc, argv);
print(load(in));
printf("\n");
Value v = load(in);
fclose(in);
if (v == Qundef)
error("%s", error_message());
print(v);
printf("\n");
return 0;
}

0 comments on commit cb54fa2

Please sign in to comment.