From: Wolfgang Bangerth Date: Fri, 17 Feb 2006 20:09:50 +0000 (+0000) Subject: Fix a bug where ParameterHandler::get_integer falsly stated that a string X-Git-Tag: v8.0.0~12282 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ce087fc2527c33d52cc80b8fd34a25b115ceb8b;p=dealii.git Fix a bug where ParameterHandler::get_integer falsly stated that a string 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 --- diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index 0b0003a778..c1b5761d47 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -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; } diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 0f2d4d961f..90af00449c 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -247,6 +247,15 @@ inconvenience this causes.

base

    +
  1. Fixed: The ParameterHandler::get_integer + 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. +
    + (WB 2006/02/17) +

    +
  2. Improved: The ComponentSelect class can now also handle the case that one wants to select multiple vector components at once, not only a single one.