From: handa Date: Thu, 18 Feb 2010 07:40:22 +0000 (+0000) Subject: (load_charset): Check the return value of fgets. X-Git-Tag: merge-to-XML~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3d9dfdaf7baa774875ddc358966efafd1163dce4;p=m17n%2Fm17n-lib.git (load_charset): Check the return value of fgets. --- 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)