diff options
author | RobertoFresca <robbie@mamedev.org> | 2016-03-09 15:07:29 -0300 |
---|---|---|
committer | RobertoFresca <robbie@mamedev.org> | 2016-03-09 15:07:29 -0300 |
commit | 4863800544e88093710a8246ce9cc1783acdb157 (patch) | |
tree | e8cdb3f89dae3f80d252c7e320852bc16c71d2b9 | |
parent | 017be62bdcea3e8a76534594839cb01ea8ed7a51 (diff) | |
parent | 8dad674507a9e8d5ae6e3cb23df717ea0c41443b (diff) |
Merge branch 'master' of https://github.com/mamedev/mame
-rw-r--r-- | src/lib/util/corefile.cpp | 1 | ||||
-rw-r--r-- | src/lib/util/vecstream.h | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index fd98c8be59f..64169a606fc 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -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'); diff --git a/src/lib/util/vecstream.h b/src/lib/util/vecstream.h index 498e35eac5e..bf144501253 100644 --- a/src/lib/util/vecstream.h +++ b/src/lib/util/vecstream.h @@ -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)); } |