From bf734133313151fa1307846ff33e664b33297f89 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 12 Jan 2007 03:14:01 +0000 Subject: [PATCH] * input-file.c (input_file_open): Check fgets return. --- gas/ChangeLog | 4 ++++ gas/input-file.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index b3afb4bd1..58478b4cd 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2007-01-12 Alan Modra + + * input-file.c (input_file_open): Check fgets return. + 2007-01-11 Paul Brook * config/tc-arm.c (do_t_add_sub): Use Rd and Rs. diff --git a/gas/input-file.c b/gas/input-file.c index 91ec53092..0907bad37 100644 --- a/gas/input-file.c +++ b/gas/input-file.c @@ -163,8 +163,8 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ c = getc (f_in); if (c == 'N') { - fgets (buf, 80, f_in); - if (!strncmp (buf, "O_APP", 5) && ISSPACE (buf[5])) + if (fgets (buf, sizeof (buf), f_in) + && !strncmp (buf, "O_APP", 5) && ISSPACE (buf[5])) preprocess = 0; if (!strchr (buf, '\n')) ungetc ('#', f_in); /* It was longer. */ @@ -173,8 +173,8 @@ input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ } else if (c == 'A') { - fgets (buf, 80, f_in); - if (!strncmp (buf, "PP", 2) && ISSPACE (buf[2])) + if (fgets (buf, sizeof (buf), f_in) + && !strncmp (buf, "PP", 2) && ISSPACE (buf[2])) preprocess = 1; if (!strchr (buf, '\n')) ungetc ('#', f_in); -- 2.11.4.GIT