diff --git a/pystreambuf.h b/pystreambuf.h index 62c8a256..23480a1b 100644 --- a/pystreambuf.h +++ b/pystreambuf.h @@ -266,8 +266,8 @@ class streambuf : public std::basic_streambuf py::bytes chunk(pbase(), n_written); py_write(chunk); if (!traits_type::eq_int_type(c, traits_type::eof())) { - char cs[2] = {traits_type::to_char_type(c)}; - py_write(py::bytes(cs)); + char cs = traits_type::to_char_type(c); + py_write(py::bytes(&cs, 1)); n_written++; } if (n_written) {