From: Ralf Hartmann Date: Wed, 21 Sep 2005 11:54:11 +0000 (+0000) Subject: Bug fix: if string not found find_last_of returns npos instead of length! X-Git-Tag: v8.0.0~13115 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=644fd45905010e913e1a4c620de54416e1cd5ee3;p=dealii.git Bug fix: if string not found find_last_of returns npos instead of length! git-svn-id: https://svn.dealii.org/trunk@11488 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/grid_in.cc b/deal.II/deal.II/source/grid/grid_in.cc index 2ffae5cdb5..7761707bce 100644 --- a/deal.II/deal.II/source/grid/grid_in.cc +++ b/deal.II/deal.II/source/grid/grid_in.cc @@ -1016,7 +1016,7 @@ void GridIn::read (const std::string& filename, const unsigned int slashpos = name.find_last_of('/'); const unsigned int dotpos = name.find_last_of('.'); if (dotpos < name.length() - && (dotpos > slashpos || slashpos == name.length())) + && (dotpos > slashpos || slashpos == name.npos)) { std::string ext = name.substr(dotpos+1); format = parse_format(ext);