]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Bug fix: if string not found find_last_of returns npos instead of length!
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 21 Sep 2005 11:54:11 +0000 (11:54 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 21 Sep 2005 11:54:11 +0000 (11:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@11488 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_in.cc

index 2ffae5cdb53b3c7382b6c1a6aaad5e3d0bafb8c2..7761707bce03956362bf8da7399ebc7db19641f5 100644 (file)
@@ -1016,7 +1016,7 @@ void GridIn<dim>::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);

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.