mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-08-23 01:25:52 +03:00
sch2fig/main.c (read_file): be civil and report errors
This commit is contained in:
parent
adf9efdd95
commit
09ae0229c3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user