aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-import.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-05-29 05:04:49 +0800
committerChristian Persch <chpe@src.gnome.org>2005-05-29 05:04:49 +0800
commit995f6539fb26444a0496b6311fecdbe9ad9cc8ff (patch)
tree99251864a6a326fbbcb168bf1053a32c6134e5a4 /src/bookmarks/ephy-bookmarks-import.c
parent10c97477f0a3ca8863bba42ec7c5a95985fe0313 (diff)
downloadgsoc2013-epiphany-995f6539fb26444a0496b6311fecdbe9ad9cc8ff.tar.gz
gsoc2013-epiphany-995f6539fb26444a0496b6311fecdbe9ad9cc8ff.tar.zst
gsoc2013-epiphany-995f6539fb26444a0496b6311fecdbe9ad9cc8ff.zip
Check return value of fgets.
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.
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;