From 995f6539fb26444a0496b6311fecdbe9ad9cc8ff Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 28 May 2005 21:04:49 +0000 Subject: Check return value of fgets. 2005-05-28 Christian Persch * src/bookmarks/ephy-bookmarks-import.c: (gul_general_read_line_from_file): Check return value of fgets. --- src/bookmarks/ephy-bookmarks-import.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/bookmarks') diff --git a/src/bookmarks/ephy-bookmarks-import.c b/src/bookmarks/ephy-bookmarks-import.c index 47cf97f34..e56442437 100644 --- a/src/bookmarks/ephy-bookmarks-import.c +++ b/src/bookmarks/ephy-bookmarks-import.c @@ -488,10 +488,12 @@ gul_general_read_line_from_file (FILE *f) gchar *t; gchar *buf = g_new0 (gchar, 256); while ( ! ( strchr (buf, '\n') || feof (f) ) ) { - fgets(buf, 256, f); - t = line; - line = g_strconcat (line, buf, NULL); - g_free (t); + if (fgets(buf, 256, f)) + { + t = line; + line = g_strconcat (line, buf, NULL); + g_free (t); + } } g_free (buf); return line; -- cgit v1.2.3