Commit edc2a9ab authored by mattijs's avatar mattijs
Browse files

BUG: ISstream: only check character if reading succeeded

parent 7f95c64b
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -59,7 +59,7 @@ inline Foam::ISstream& Foam::ISstream::get(char& c) ...@@ -59,7 +59,7 @@ inline Foam::ISstream& Foam::ISstream::get(char& c)
is_.get(c); is_.get(c);
setState(is_.rdstate()); setState(is_.rdstate());
if (c == '\n') if (good() && c == '\n')
{ {
lineNumber_++; lineNumber_++;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment