1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-12-22 23:41:10 +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:
werner 2010-04-20 03:16:09 +00:00
parent 6b22c8a579
commit b7db446cbb

7
fped.c
View File

@ -41,8 +41,11 @@ static void load_file(const char *name)
file = fopen(name, "r");
if (file) {
if (!fgets(line, sizeof(line), file)) {
perror(name);
exit(1);
if (ferror(file)) {
perror(name);
exit(1);
}
*line = 0;
}
no_save = strcmp(line, MACHINE_GENERATED);
fclose(file);