aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c10
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8aacf19ab..4a471bf52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2005-05-28 Christian Persch <chpe@cvs.gnome.org>
+ * src/bookmarks/ephy-bookmarks-import.c:
+ (gul_general_read_line_from_file):
+
+ Check return value of fgets.
+
+2005-05-28 Christian Persch <chpe@cvs.gnome.org>
+
* doc/reference/Makefile.am:
Add python libs when building with python bindings. Fixes bug #305767.
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;