Visitar URL original
fix boost::network::uri::decode error - out of range because of '%' by cnagune · Pull Request #553 · cpp-netlib/cpp-netlib · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
change std::out_of_range constractor string (what_arg)
  • Loading branch information
cnagune committed Aug 14, 2015
commit 8f5831fef7339ab202ee010bd186fb08a9a7810c
4 changes: 2 additions & 2 deletions boost/network/uri/decode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ OutputIterator decode(const InputIterator &in_begin,
OutputIterator out = out_begin;
while (it != in_end) {
if (*it == '%') {
if (++it == in_end) throw std::out_of_range("out_of_range exception");
if (++it == in_end) throw std::out_of_range("unexpected end of stream");
value_type v0 = detail::letter_to_hex(*it);
if (++it == in_end) throw std::out_of_range("out_of_range exception");
if (++it == in_end) throw std::out_of_range("unexpected end of stream");
value_type v1 = detail::letter_to_hex(*it);
++it;
*out++ = 0x10 * v0 + v1;
Expand Down