From: Timo Kokkonen Date: Mon, 23 Jul 2012 15:01:28 +0000 (+0300) Subject: Do not return error if no more entries are read X-Git-Url: http://git.itanic.dy.fi/?p=glucose;a=commitdiff_plain;h=0d76cc50c3fc819f3af93c4046365f38789e7fc3 Do not return error if no more entries are read Since commit 009c9b76361 the tool was always returning an error condition when the last entry was read from the meter. This is not correct as reading the last entry is not an error condition. Unfortunately it is not know how to detect the lack of entries from the device from the last read entry. Therefore, in case we fail to read proper data from the device, we will always assume we were able to read all entries. Signed-off-by: Timo Kokkonen --- diff --git a/main.c b/main.c index 449fa15..f0faa44 100644 --- a/main.c +++ b/main.c @@ -117,7 +117,7 @@ static int dump_entries(struct user_options *opts, int fd, int usage_code) while (1) { ret = contour_read_entry(fd, usage_code, &msg); if (ret < 45) - return -1; + break; ret = format_message(opts, &msg, ret); if (ret < 0)