mirror of
git://projects.qi-hardware.com/fped.git
synced 2024-11-26 04:12:28 +02:00
- fped.c (load_file): don't falsely complain about empty files
git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5925 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
parent
6b22c8a579
commit
b7db446cbb
3
fped.c
3
fped.c
@ -41,9 +41,12 @@ static void load_file(const char *name)
|
|||||||
file = fopen(name, "r");
|
file = fopen(name, "r");
|
||||||
if (file) {
|
if (file) {
|
||||||
if (!fgets(line, sizeof(line), file)) {
|
if (!fgets(line, sizeof(line), file)) {
|
||||||
|
if (ferror(file)) {
|
||||||
perror(name);
|
perror(name);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
*line = 0;
|
||||||
|
}
|
||||||
no_save = strcmp(line, MACHINE_GENERATED);
|
no_save = strcmp(line, MACHINE_GENERATED);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
reporter = report_parse_error;
|
reporter = report_parse_error;
|
||||||
|
Loading…
Reference in New Issue
Block a user