From 644fd45905010e913e1a4c620de54416e1cd5ee3 Mon Sep 17 00:00:00 2001 From: Ralf Hartmann Date: Wed, 21 Sep 2005 11:54:11 +0000 Subject: [PATCH] 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 --- deal.II/deal.II/source/grid/grid_in.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5