str/buf: Fix when sizeof(CharT) == sizeof(CharT*)
We weren't allocating enough space for the proper structure alignment on
little endian systems.
Change-Id: I7a2ae9ba0d7a81dff3d30c7179bc230e82cb235a
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include/stdplus/str/buf.hpp b/include/stdplus/str/buf.hpp
index 834f154..2725e21 100644
--- a/include/stdplus/str/buf.hpp
+++ b/include/stdplus/str/buf.hpp
@@ -24,8 +24,8 @@
} inl;
struct Dyn
{
- std::uint8_t
- rsvd[offsetof(Inl, len) - sizeof(CharT*) - sizeof(std::size_t) * 2];
+ std::uint8_t rsvd[offsetof(Inl, len) + 1 - sizeof(CharT*) -
+ sizeof(std::size_t) * 2];
CharT* ptr;
std::size_t cap;
std::size_t len;