mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
Allow seek to position 0 in a vectorstream with empty storage, always reserve 1k for core_file printf buffer
This commit is contained in:
parent
5fa07c9202
commit
8dad674507
@ -613,6 +613,7 @@ int core_text_file::puts(char const *s)
|
||||
|
||||
int core_text_file::vprintf(util::format_argument_pack<std::ostream> const &args)
|
||||
{
|
||||
m_printf_buffer.reserve(1024);
|
||||
m_printf_buffer.seekp(0, ovectorstream::beg);
|
||||
util::stream_format<std::ostream, std::ostream>(m_printf_buffer, args);
|
||||
m_printf_buffer.put('\0');
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
|
||||
void reserve(typename vector_type::size_type size)
|
||||
{
|
||||
if ((m_mode & std::ios_base::out) && (m_storage.size() < size))
|
||||
if ((m_mode & std::ios_base::out) && (m_storage.capacity() < size))
|
||||
{
|
||||
m_storage.reserve(size);
|
||||
adjust();
|
||||
@ -150,8 +150,8 @@ protected:
|
||||
bool const out(which & std::ios_base::out);
|
||||
if ((!in && !out) ||
|
||||
(in && out && (std::ios_base::cur == dir)) ||
|
||||
(in && (!(m_mode & std::ios_base::in) || !this->gptr())) ||
|
||||
(out && (!(m_mode & std::ios_base::out) || !this->pptr())))
|
||||
(in && !(m_mode & std::ios_base::in)) ||
|
||||
(out && !(m_mode & std::ios_base::out)))
|
||||
{
|
||||
return pos_type(off_type(-1));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user