From 3d9dfdaf7baa774875ddc358966efafd1163dce4 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 18 Feb 2010 07:40:22 +0000 Subject: [PATCH] (load_charset): Check the return value of fgets. --- src/charset.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/charset.c b/src/charset.c index 73b5179..88649fd 100644 --- a/src/charset.c +++ b/src/charset.c @@ -353,7 +353,8 @@ load_charset (FILE *fp, MSymbol charset_name) char buf[256]; ungetc (c, fp); - fgets (buf, 256, fp); + if (! fgets (buf, 256, fp)) + break; if (c != '#') { if (sscanf (buf, "0x%x-0x%x 0x%x", &code1, &code2, &c1) == 3) -- 1.7.10.4