BUG: ISstream: only check character if reading succeeded

This commit is contained in:
mattijs
2015-11-11 12:48:51 +00:00
parent 7f95c64b16
commit edc2a9ab8d

View File

@ -2,8 +2,8 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -59,7 +59,7 @@ inline Foam::ISstream& Foam::ISstream::get(char& c)
is_.get(c);
setState(is_.rdstate());
if (c == '\n')
if (good() && c == '\n')
{
lineNumber_++;
}