From 97cdc8b97cd687287ff9314ba88a0df6eea4dc44 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 11 Jun 2005 05:03:33 +0000 Subject: [PATCH] be more carefull in checking for sucessful open git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@619 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c index 2b0f3039..11476de4 100644 --- a/program/src/rrd_open.c +++ b/program/src/rrd_open.c @@ -107,7 +107,7 @@ rrd_open(const char *file_name, FILE **in_file, rrd_t *rrd, int rdwr) MYFREAD(rrd->stat_head, stat_head_t, 1) /* lets see if the first read worked */ - if (ferror( *in_file )){ + if (ferror( *in_file ) || feof(*in_file)) { rrd_set_error("reading the cookie off %s faild",file_name); fclose(*in_file); return(-1); -- 2.30.2