Skip to content

Commit 8ef3115

Browse files
committed
fix signed warning
1 parent 57724f2 commit 8ef3115

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cpp/include/mh/text/indenting_ostream.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ namespace mh
3030
CharT get_indent_char() const { return m_IndentChar; }
3131

3232
protected:
33-
std::streamsize xsputn(const CharT* s, std::streamsize count) override
33+
std::streamsize xsputn(const CharT* s, std::streamsize countSigned) override
3434
{
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+
3540
// Just for debugging
3641
[[maybe_unused]] const auto originalS = s;
3742
const auto originalCount = count;

0 commit comments

Comments
 (0)