diff --git a/src/eepp/ui/uiscenenode.cpp b/src/eepp/ui/uiscenenode.cpp index dce59e127..182f70d6d 100644 --- a/src/eepp/ui/uiscenenode.cpp +++ b/src/eepp/ui/uiscenenode.cpp @@ -444,9 +444,11 @@ void UISceneNode::setThreadPool( const std::shared_ptr& threadPool ) } static std::string getErrorContext( size_t offset, std::string_view content ) { - static constexpr auto CONTEXT_LENGTH = 40; - std::size_t left = std::max( 0ul, offset - CONTEXT_LENGTH ); - std::size_t right = std::min( content.size(), offset + 40 ); + static constexpr std::size_t CONTEXT_LENGTH = 40; + std::size_t minVal = offset - CONTEXT_LENGTH; + std::size_t maxVal = offset + CONTEXT_LENGTH; + std::size_t left = std::max( static_cast( 0ul ), minVal ); + std::size_t right = std::min( content.size(), maxVal ); return std::string{ content.substr( left, right - left ) }; }