summaryrefslogtreecommitdiff
path: root/src/Fl_PNM_Image.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-12-11 16:03:13 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-12-11 16:03:13 +0000
commitfdcdc8fd46547a7cd77010db6b57f9cc9f4f51d1 (patch)
treee7cfd7b774e59fe9b2092ede165e3dd058a20955 /src/Fl_PNM_Image.cxx
parent6905f61c2c00bd2e6777b0ab9d843fbe1a46dcc4 (diff)
Multiple fixes from Sebastien.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1833 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_PNM_Image.cxx')
-rw-r--r--src/Fl_PNM_Image.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Fl_PNM_Image.cxx b/src/Fl_PNM_Image.cxx
index 13bcb8e49..0f5801f0b 100644
--- a/src/Fl_PNM_Image.cxx
+++ b/src/Fl_PNM_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_PNM_Image.cxx,v 1.1.2.2 2001/11/28 18:09:08 easysw Exp $"
+// "$Id: Fl_PNM_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $"
//
// Fl_PNM_Image routines.
//
@@ -24,6 +24,7 @@
//
// Contents:
//
+// Fl_PNM_Image::Fl_PNM_Image() - Load a PNM image...
//
//
@@ -73,6 +74,12 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
//
lineptr = fgets(line, sizeof(line), fp);
+ if (!lineptr) {
+ Fl::error("Early end-of-file in PNM file \"%s\"!", name);
+ fclose(fp);
+ return;
+ }
+
lineptr ++;
format = atoi(lineptr);
@@ -159,5 +166,5 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
//
-// End of "$Id: Fl_PNM_Image.cxx,v 1.1.2.2 2001/11/28 18:09:08 easysw Exp $".
+// End of "$Id: Fl_PNM_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $".
//