]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a bug where ParameterHandler::get_integer falsly stated that a string
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 17 Feb 2006 20:09:50 +0000 (20:09 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 17 Feb 2006 20:09:50 +0000 (20:09 +0000)
represents a number, but silently (and erroneously) returned zero if the
string was invalid.

git-svn-id: https://svn.dealii.org/trunk@12400 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/parameter_handler.cc
deal.II/doc/news/changes.html

index 0b0003a7787ef64c531e31007a029731519057c3..c1b5761d47aaade0a36f953df05f76e4a9eedc33 100644 (file)
@@ -730,8 +730,7 @@ long int ParameterHandler::get_integer (const std::string &entry_string) const
   char *endptr;
   long int i = std::strtol (s.c_str(), &endptr, 10);
                                   // assert there was no error
-  AssertThrow ((s.c_str()!='\0') || (*endptr == '\0'),
-              ExcConversionError(s));
+  AssertThrow (*endptr == '\0', ExcConversionError(s));
 
   return i;
 }
index 0f2d4d961f2f98b11b3978481860b81fe3a2411f..90af00449cb7c77fa238492e6fa9def4366bb86b 100644 (file)
@@ -247,6 +247,15 @@ inconvenience this causes.
 <h3>base</h3>
 
 <ol>
+  <li> <p>Fixed: The <code class="member">ParameterHandler::get_integer</code>
+       had an erroneous check that the value given for a parameter really
+       represented an integer. This check always succeeded, even in face of an
+       error, and a zero value was returned every time the value in the
+       parameter file happened to be not an integer.
+       <br>
+       (WB 2006/02/17)
+       </p>
+
   <li> <p>Improved: The <code class="class">ComponentSelect</code> class can
        now also handle the case that one wants to select multiple vector
        components at once, not only a single one.

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.