From fb4b39c6e0e8088a09e7f1205e95d0c9e9e74b80 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 23 Apr 2018 16:05:21 +0200 Subject: [PATCH] Use correct type in GridIn::skip_comment_lines --- source/grid/grid_in.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index b1f8029137..e5b389b91e 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -2738,7 +2738,7 @@ void GridIn::skip_comment_lines (std::istream &in, char c; // loop over the following comment // lines - while ((c=in.get()) == comment_start) + while (in.get(c) && c == comment_start) // loop over the characters after // the comment starter while (in.get() != '\n') @@ -2747,7 +2747,8 @@ void GridIn::skip_comment_lines (std::istream &in, // put back first character of // first non-comment line - in.putback (c); + if (in) + in.putback (c); // at last: skip additional empty lines, if present skip_empty_lines(in); -- 2.39.5