]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use correct type in GridIn::skip_comment_lines
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 23 Apr 2018 14:05:21 +0000 (16:05 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Mon, 23 Apr 2018 16:25:33 +0000 (18:25 +0200)
source/grid/grid_in.cc

index b1f8029137719345f7d92a1fb63fb867a30065d8..e5b389b91e3dc349ffa6a1c3de690050697c9db6 100644 (file)
@@ -2738,7 +2738,7 @@ void GridIn<dim, spacedim>::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<dim, spacedim>::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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.