From f5963dc4370617ef11dc8ec49a0dea63cceafae9 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Sat, 1 Sep 2007 21:55:49 +0000 Subject: [PATCH] read_description() should return 0 on the last item and not EOF --- tools/emile_config.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/emile_config.c b/tools/emile_config.c index 036e582..84c776a 100644 --- a/tools/emile_config.c +++ b/tools/emile_config.c @@ -243,9 +243,8 @@ static int read_description(FILE* fd, char* desc, int size) char name[256]; char value[1024]; 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) { @@ -284,7 +283,7 @@ static int read_description(FILE* fd, char* desc, int size) } offset = ftell(fd); } - return ret; + return found ? 0 : -1; } int emile_config_read_next(emile_config* config)