avoid allocating potentially large std::string in error_handler

This commit is contained in:
artemp 2014-09-23 14:02:08 +01:00
parent f4694d03ff
commit 1382e57ebe

View file

@ -97,7 +97,7 @@ struct error_handler
Iterator first, Iterator last,
Iterator err_pos, boost::spirit::info const& what) const
{
MAPNIK_LOG_ERROR(error_handler) << what << " expected but got: " << where_message()(err_pos, last, 16);
MAPNIK_LOG_ERROR(error_handler) << what << " expected but got: " << std::string(err_pos, std::min(err_pos + 16,last));
}
};