changed: SessionParser::ReadLong() can read negative values

git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@531 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2009-11-21 00:08:08 +00:00
parent 4827c116f0
commit 2dff0bed72
1 changed files with 10 additions and 0 deletions

View File

@ -134,15 +134,25 @@ void SessionParser::SkipLine()
long SessionParser::ReadLong()
{
long res = 0;
bool is_sign = false;
SkipWhite();
if( last == '-' )
{
is_sign = true;
last = file.get();
}
while( IsDigit(last) )
{
res = res*10 + (last-'0');
last = file.get();
}
if( is_sign )
res = -res;
return res;
}