summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/src/strstream.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-04-27 22:47:52 +0000
committerdim <dim@FreeBSD.org>2013-04-27 22:47:52 +0000
commit815a6cc1e325a4e8596b91756039a7d699471b11 (patch)
treee5a6a26d0973c6968273f6fabb61cb3d624be555 /contrib/libc++/src/strstream.cpp
parent1497a98f71419ff66d08ad2b8c90530e65521ac2 (diff)
downloadFreeBSD-src-815a6cc1e325a4e8596b91756039a7d699471b11.zip
FreeBSD-src-815a6cc1e325a4e8596b91756039a7d699471b11.tar.gz
Merge libc++ trunk r180598. Contains several minor cleanups and bug
fixes, no major changes. MFC after: 2 weeks
Diffstat (limited to 'contrib/libc++/src/strstream.cpp')
-rw-r--r--contrib/libc++/src/strstream.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/libc++/src/strstream.cpp b/contrib/libc++/src/strstream.cpp
index 8cd19e6..518422b 100644
--- a/contrib/libc++/src/strstream.cpp
+++ b/contrib/libc++/src/strstream.cpp
@@ -158,6 +158,8 @@ strstreambuf::overflow(int_type __c)
return int_type(EOF);
streamsize old_size = (epptr() ? epptr() : egptr()) - eback();
streamsize new_size = max<streamsize>(__alsize_, 2*old_size);
+ if (new_size == 0)
+ new_size = __default_alsize;
char* buf = nullptr;
if (__palloc_)
buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size)));
OpenPOWER on IntegriCloud