summaryrefslogtreecommitdiff
path: root/src/Fl_PNM_Image.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-25 13:38:25 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-25 13:38:25 +0000
commitacd6bd5cc858284f12e1330d4acd49cad47e7f82 (patch)
tree73b95e9fb388772fd51321b5043324ce73718d33 /src/Fl_PNM_Image.cxx
parent62424b33c5dc5fc74263ba4205f9562e5864b8c3 (diff)
Clean up string includes.
Fix Fl_Shared_Image::add_handler() and friends. Fix Fl_PNM_Image loader. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2260 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_PNM_Image.cxx')
-rw-r--r--src/Fl_PNM_Image.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Fl_PNM_Image.cxx b/src/Fl_PNM_Image.cxx
index 2427122fe..d3dc8b59b 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.6 2002/04/11 11:52:41 easysw Exp $"
+// "$Id: Fl_PNM_Image.cxx,v 1.1.2.7 2002/05/25 13:38:24 easysw Exp $"
//
// Fl_PNM_Image routines.
//
@@ -33,11 +33,9 @@
#include <FL/Fl.H>
#include <FL/Fl_PNM_Image.H>
-#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include "flstring.h"
-#include <ctype.h>
//
@@ -89,17 +87,15 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
if (*lineptr == '\0' || *lineptr == '#') {
lineptr = fgets(line, sizeof(line), fp);
} else if (isdigit(*lineptr)) {
- w(atoi(lineptr));
- while (isdigit(*lineptr)) lineptr ++;
+ w(strtol(lineptr, &lineptr, 10));
} else lineptr ++;
}
- while (lineptr != NULL && h()) {
+ while (lineptr != NULL && h() == 0) {
if (*lineptr == '\0' || *lineptr == '#') {
lineptr = fgets(line, sizeof(line), fp);
} else if (isdigit(*lineptr)) {
- h(atoi(lineptr));
- while (isdigit(*lineptr)) lineptr ++;
+ h(strtol(lineptr, &lineptr, 10));
} else lineptr ++;
}
@@ -110,8 +106,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
if (*lineptr == '\0' || *lineptr == '#') {
lineptr = fgets(line, sizeof(line), fp);
} else if (isdigit(*lineptr)) {
- maxval = atoi(lineptr);
- while (isdigit(*lineptr)) lineptr ++;
+ maxval = strtol(lineptr, &lineptr, 10);
} else lineptr ++;
}
} else maxval = 1;
@@ -166,5 +161,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.6 2002/04/11 11:52:41 easysw Exp $".
+// End of "$Id: Fl_PNM_Image.cxx,v 1.1.2.7 2002/05/25 13:38:24 easysw Exp $".
//