read_description() should return 0 on the last item and not EOF

This commit is contained in:
Laurent Vivier 2007-09-01 21:55:49 +00:00
parent 6b07f02989
commit f5963dc437

View File

@ -243,9 +243,8 @@ static int read_description(FILE* fd, char* desc, int size)
char name[256]; char name[256];
char value[1024]; char value[1024];
int found = 0; int found = 0;
int ret;
while ((ret = read_line(fd, name, value)) != -1) while (read_line(fd, name, value) != -1)
{ {
if (strcmp("title", name) == 0) if (strcmp("title", name) == 0)
{ {
@ -284,7 +283,7 @@ static int read_description(FILE* fd, char* desc, int size)
} }
offset = ftell(fd); offset = ftell(fd);
} }
return ret; return found ? 0 : -1;
} }
int emile_config_read_next(emile_config* config) int emile_config_read_next(emile_config* config)