return(0);
if (c == (int) '#')
PNMComment(image,exception);
- } while (isdigit(c) == MagickFalse);
+ } while ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'));
if (base == 2)
return((unsigned int) (c-(int) '0'));
/*
Evaluate number.
*/
value=0;
- do
- {
+ while (isdigit(c) != 0) {
if (value > (unsigned int) (INT_MAX/10))
break;
value*=10;
- if (value > (INT_MAX-c))
+ if (value > (INT_MAX-(c-(int) '0')))
break;
value+=c-(int) '0';
c=ReadBlobByte(image);
- } while (isdigit(c) != 0);
+ if (c == EOF)
+ return(0);
+ }
return(value);
}