From: Wolfgang Bangerth Date: Fri, 26 May 2017 16:03:29 +0000 (-0600) Subject: Check that a stream is good while we read. X-Git-Tag: v9.0.0-rc1~1573^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dae46e968aa0a3be8a5ab10073d6577a3c380a9;p=dealii.git Check that a stream is good while we read. This addresses another (correct) Coverity warning. --- diff --git a/source/base/index_set.cc b/source/base/index_set.cc index 81e98c95e6..4ed7b59b3a 100644 --- a/source/base/index_set.cc +++ b/source/base/index_set.cc @@ -459,14 +459,18 @@ IndexSet::write(std::ostream &out) const void IndexSet::read(std::istream &in) { + AssertThrow (in, ExcIO()); + size_type s; - unsigned int numranges; + unsigned int n_ranges; - in >> s >> numranges; + in >> s >> n_ranges; ranges.clear(); set_size(s); - for (unsigned int i=0; i> b >> e; add_range(b,e);