mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-05 16:50:17 +02: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;
|
char *nl;
|
||||||
|
|
||||||
file = fopen(name, "r");
|
file = fopen(name, "r");
|
||||||
|
if (!file) {
|
||||||
|
perror(name);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
while (fgets(buf, sizeof(buf), file)) {
|
while (fgets(buf, sizeof(buf), file)) {
|
||||||
nl = strchr(buf, '\n');
|
nl = strchr(buf, '\n');
|
||||||
if (nl)
|
if (nl)
|
||||||
|
Loading…
Reference in New Issue
Block a user