Exit with nonzero status on error

This commit is contained in:
Bartek Gąsiorzewski
2018-05-07 22:10:55 +02:00
parent 6b8fd6f33f
commit ae4ec1a06d
2 changed files with 4 additions and 4 deletions

View File

@ -208,19 +208,19 @@ void error(const char *s)
{
perror(s);
assert(0);
exit(-1);
exit(1);
}
void malloc_error()
{
fprintf(stderr, "Malloc error\n");
exit(-1);
exit(1);
}
void file_error(char *s)
{
fprintf(stderr, "Couldn't open file: %s\n", s);
exit(0);
exit(1);
}
list *split_str(char *s, char delim)