Skip to content

Commit f50b027

Browse files
committed
Don't increment environment pointer past the end.
This should not effect correct programs, since once the iterator itself is past-the-end, it should not matter what the underlying state of that iterator is. But, the new behaviour is more obvious.
1 parent 3ce1c74 commit f50b027

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/boost/program_options/environment_iterator.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ namespace boost {
4040
assert(n != s.npos);
4141
value().first = s.substr(0, n);
4242
value().second = s.substr(n+1);
43-
}
44-
++m_environment;
43+
44+
++m_environment;
45+
}
4546
}
4647

4748
private:

0 commit comments

Comments
 (0)