diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-28 15:23:03 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-28 15:23:03 +0000 |
| commit | 96094e5617f0762538b12d5ba3cfead3d809b73c (patch) | |
| tree | 307e5d9fabe69e1586e28e6dfe12d94e5250230b /src | |
| parent | cb49cb970e2f8a3afaf6d45066a06f7914241597 (diff) | |
Increase size of header buffer to 64 bytes.
Fix XBM file loader.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2327 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Shared_Image.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_XBM_Image.cxx | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx index 916ad8009..46d5359a5 100644 --- a/src/Fl_Shared_Image.cxx +++ b/src/Fl_Shared_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Shared_Image.cxx,v 1.23.2.12 2002/05/25 13:38:24 easysw Exp $" +// "$Id: Fl_Shared_Image.cxx,v 1.23.2.13 2002/06/28 15:23:03 easysw Exp $" // // Shared image code for the Fast Light Tool Kit (FLTK). // @@ -210,7 +210,7 @@ Fl_Shared_Image::reload() { // Load image from disk... int i; // Looping var FILE *fp; // File pointer - uchar header[16]; // Buffer for auto-detecting files + uchar header[64]; // Buffer for auto-detecting files Fl_Image *img; // New image if (!name_) return; @@ -461,5 +461,5 @@ Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) { // -// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.12 2002/05/25 13:38:24 easysw Exp $". +// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.13 2002/06/28 15:23:03 easysw Exp $". // diff --git a/src/Fl_XBM_Image.cxx b/src/Fl_XBM_Image.cxx index 608584501..1de0bb6b0 100644 --- a/src/Fl_XBM_Image.cxx +++ b/src/Fl_XBM_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_XBM_Image.cxx,v 1.1.2.5 2002/05/25 13:38:24 easysw Exp $" +// "$Id: Fl_XBM_Image.cxx,v 1.1.2.6 2002/06/28 15:23:03 easysw Exp $" // // Fl_XBM_Image routines. // @@ -76,7 +76,7 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { h(wh[1]); int n = ((wh[0]+7)/8)*wh[1]; - array = new uchar[((w() + 7) / 8) * h()]; + array = new uchar[n]; // read the data: for (i = 0, data = (uchar *)array; i < n;) { @@ -87,7 +87,10 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { const char *a = buffer; while (*a && i<n) { int t; - if (sscanf(a," 0x%x",&t)>0) *data++ = t; + if (sscanf(a," 0x%x",&t)>0) { + *data++ = t; + i ++; + } while (*a && *a++ != ','); } } @@ -97,5 +100,5 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) { // -// End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.5 2002/05/25 13:38:24 easysw Exp $". +// End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.6 2002/06/28 15:23:03 easysw Exp $". // |
