aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-import.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-import.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-import.c10
1 files changed, 6 insertions, 4 deletions
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;