diff --git a/src/utils/xstring.h b/src/utils/xstring.h index facb6191..e03f00ed 100644 --- a/src/utils/xstring.h +++ b/src/utils/xstring.h @@ -72,7 +72,9 @@ template T templateIntegerDecFromIstream(std::istream* is) 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(!pre)