Skip to content

Commit

Permalink
[utils] Bind std::isspace safely
Browse files Browse the repository at this point in the history
  • Loading branch information
ricab committed Oct 30, 2023
1 parent 93bbdeb commit e118b9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/multipass/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ class Utils : public Singleton<Utils>

namespace multipass::utils::detail
{
inline constexpr auto is_space = static_cast<int (*)(int)>(std::isspace);
// see https://en.cppreference.com/w/cpp/string/byte/isspace#Notes
inline constexpr auto is_space = [](unsigned char c) { return std::isspace(c); };
}

template <typename Str, typename Filter>
Expand Down

0 comments on commit e118b9a

Please sign in to comment.