diff --git a/ChangeLog b/ChangeLog index 316987a1af..bba5485b9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Jan 22 12:40:48 2000 Owen Taylor + + * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite + to account for the fact that feof() does _not_ + return TRUE on errors, and thus avoid infinite loops + when trying to use gdk_pixmap_create_from_xpm() + on unreadable values. + Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 316987a1af..bba5485b9a 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,11 @@ +Sat Jan 22 12:40:48 2000 Owen Taylor + + * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite + to account for the fact that feof() does _not_ + return TRUE on errors, and thus avoid infinite loops + when trying to use gdk_pixmap_create_from_xpm() + on unreadable values. + Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 316987a1af..bba5485b9a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Sat Jan 22 12:40:48 2000 Owen Taylor + + * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite + to account for the fact that feof() does _not_ + return TRUE on errors, and thus avoid infinite loops + when trying to use gdk_pixmap_create_from_xpm() + on unreadable values. + Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 316987a1af..bba5485b9a 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Sat Jan 22 12:40:48 2000 Owen Taylor + + * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite + to account for the fact that feof() does _not_ + return TRUE on errors, and thus avoid infinite loops + when trying to use gdk_pixmap_create_from_xpm() + on unreadable values. + Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 316987a1af..bba5485b9a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Sat Jan 22 12:40:48 2000 Owen Taylor + + * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite + to account for the fact that feof() does _not_ + return TRUE on errors, and thus avoid infinite loops + when trying to use gdk_pixmap_create_from_xpm() + on unreadable values. + Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 316987a1af..bba5485b9a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Sat Jan 22 12:40:48 2000 Owen Taylor + + * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite + to account for the fact that feof() does _not_ + return TRUE on errors, and thus avoid infinite loops + when trying to use gdk_pixmap_create_from_xpm() + on unreadable values. + Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 316987a1af..bba5485b9a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Sat Jan 22 12:40:48 2000 Owen Taylor + + * gdk/gdkpixmap.c (gdk_pixmap_seek_string): Rewrite + to account for the fact that feof() does _not_ + return TRUE on errors, and thus avoid infinite loops + when trying to use gdk_pixmap_create_from_xpm() + on unreadable values. + Fri Jan 21 18:32:43 2000 Owen Taylor * gtk/gtkaspectframe.h (struct _GtkAspectFrame): s/gint/gboolean/. diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c index 6fc47e316e..b7a3991614 100644 --- a/gdk/gdkpixmap.c +++ b/gdk/gdkpixmap.c @@ -197,21 +197,23 @@ gdk_pixmap_seek_string (FILE *infile, { char instr[1024]; - while (!feof (infile)) + while (1) { - fscanf (infile, "%1023s", instr); + if (fscanf (infile, "%1023s", instr) != 1) + return FALSE; + if (skip_comments == TRUE && strcmp (instr, "/*") == 0) { - fscanf (infile, "%1023s", instr); - while (!feof (infile) && strcmp (instr, "*/") != 0) - fscanf (infile, "%1023s", instr); - fscanf(infile, "%1023s", instr); + do + { + if (fscanf (infile, "%1023s", instr) != 1) + return FALSE; + } + while (strcmp (instr, "*/") != 0); } - if (strcmp (instr, str)==0) + else if (strcmp (instr, str) == 0) return TRUE; } - - return FALSE; } static gint