diff --git a/sch2fig/main.c b/sch2fig/main.c index 87dfeba..310eaf4 100644 --- a/sch2fig/main.c +++ b/sch2fig/main.c @@ -40,6 +40,10 @@ static void read_file(const char *name, void *ctx, char *nl; file = fopen(name, "r"); + if (!file) { + perror(name); + exit(1); + } while (fgets(buf, sizeof(buf), file)) { nl = strchr(buf, '\n'); if (nl)