aboutsummaryrefslogtreecommitdiff
path: root/system/lib/libcxx/strstream.cpp
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2013-03-29 16:19:55 +0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2013-03-29 16:19:55 +0700
commitaa0108c75e4177b6db0705ce42998e92c6ac734f (patch)
treec0ec6d57dcb70dfaba808a8c74b8e892d712051b /system/lib/libcxx/strstream.cpp
parente3d12277cdbb3c47ddeacf1fa005f2964debefbb (diff)
Update to r178253 from March 29, 2013.
Diffstat (limited to 'system/lib/libcxx/strstream.cpp')
-rw-r--r--system/lib/libcxx/strstream.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/system/lib/libcxx/strstream.cpp b/system/lib/libcxx/strstream.cpp
index 8cd19e6a..518422bd 100644
--- a/system/lib/libcxx/strstream.cpp
+++ b/system/lib/libcxx/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)));