sturdier fm2 loader

This commit is contained in:
zeromus 2008-08-10 04:28:53 +00:00
parent 1cb06319e9
commit 19100f0259
1 changed files with 3 additions and 1 deletions

View File

@ -72,7 +72,9 @@ template<typename T> T templateIntegerDecFromIstream(std::istream* is)
for(;;) for(;;)
{ {
int d = is->get() - '0'; int c = is->get();
if(c == -1) return ret;
int d = c - '0';
if((d<0 || d>9)) if((d<0 || d>9))
{ {
if(!pre) if(!pre)