< prev index next >

src/share/vm/logging/logStream.cpp

Print this page
rev 13113 : imported patch 8181917-refactor-ul-logstream
rev 13114 : imported patch 8181917-refactor-ul-logstream-changes-2
rev 13115 : [mq]: 8181917-refactor-ul-logstream-changes-3

@@ -56,12 +56,12 @@
   assert(_cap >= atleast, "sanity");
 }
 
 void LogStream::LineBuffer::append(const char* s, size_t len) {
   assert(_buf[_pos] == '\0', "sanity");
-  const size_t remaining = _cap - _pos;
-  ensure_cap(remaining + len + 1);
+  ensure_cap(_pos + len + 1);
+  assert(_cap >= _pos + len + 1, "sanity");
   memcpy(_buf + _pos, s, len);
   _pos += len;
   _buf[_pos] = '\0';
 }
     
< prev index next >