From 7b76d57ab946d688d152c248263ff2193e643ad1 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 13 Oct 2006 13:38:50 +0000 Subject: [PATCH] * Add feof() to the list of I/O functions. --- src/figlet.c | 2 +- src/io.c | 5 +++++ src/io.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/figlet.c b/src/figlet.c index e945713..0da08de 100644 --- a/src/figlet.c +++ b/src/figlet.c @@ -168,7 +168,7 @@ static int open_font(context_t *cx) cx->glyphs = 0; cx->lookup = NULL; - for(i = 0, size = 0; !feof(f); cx->glyphs++) + for(i = 0, size = 0; !toieof(f); cx->glyphs++) { if((cx->glyphs % 2048) == 0) cx->lookup = realloc(cx->lookup, diff --git a/src/io.c b/src/io.c index b00f796..68f7147 100644 --- a/src/io.c +++ b/src/io.c @@ -43,6 +43,11 @@ int toiclose(TOIFILE *toif) return fclose(f); } +int toieof(TOIFILE *toif) +{ + return feof(toif->f); +} + char *toigets(char *s, int size, TOIFILE *toif) { return fgets(s, size, toif->f); diff --git a/src/io.h b/src/io.h index e72ebc8..44b430d 100644 --- a/src/io.h +++ b/src/io.h @@ -22,5 +22,6 @@ TOIFILE; TOIFILE *toiopen(const char *, const char *); int toiclose(TOIFILE *); +int toieof(TOIFILE *); char *toigets(char *, int, TOIFILE *);