We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57724f2 commit 8ef3115Copy full SHA for 8ef3115
cpp/include/mh/text/indenting_ostream.hpp
@@ -30,8 +30,13 @@ namespace mh
30
CharT get_indent_char() const { return m_IndentChar; }
31
32
protected:
33
- std::streamsize xsputn(const CharT* s, std::streamsize count) override
+ std::streamsize xsputn(const CharT* s, std::streamsize countSigned) override
34
{
35
+ if (countSigned < 0)
36
+ throw std::invalid_argument("count cannot be less than zero");
37
+
38
+ size_t count = static_cast<size_t>(countSigned);
39
40
// Just for debugging
41
[[maybe_unused]] const auto originalS = s;
42
const auto originalCount = count;
0 commit comments