mirror of
git://projects.qi-hardware.com/fped.git
synced 2024-11-22 12:49:42 +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
7
fped.c
7
fped.c
@ -41,8 +41,11 @@ 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)) {
|
||||||
perror(name);
|
if (ferror(file)) {
|
||||||
exit(1);
|
perror(name);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
*line = 0;
|
||||||
}
|
}
|
||||||
no_save = strcmp(line, MACHINE_GENERATED);
|
no_save = strcmp(line, MACHINE_GENERATED);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
Loading…
Reference in New Issue
Block a user