From e118b9a1b4b11d06256b8f49a9fdcc37cd1a0fc1 Mon Sep 17 00:00:00 2001 From: Ricardo Abreu Date: Mon, 30 Oct 2023 13:55:21 +0200 Subject: [PATCH] [utils] Bind `std::isspace` safely --- include/multipass/utils.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/multipass/utils.h b/include/multipass/utils.h index 56e0a7337f7..bb4ac08cedf 100644 --- a/include/multipass/utils.h +++ b/include/multipass/utils.h @@ -242,7 +242,8 @@ class Utils : public Singleton namespace multipass::utils::detail { -inline constexpr auto is_space = static_cast(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