forked from OSchip/llvm-project
fix PR2953, an off-by-one error handling formatted i/o.
Thanks to Török Edwin for the awesome reduced testcase. llvm-svn: 58199
This commit is contained in:
parent
5cba81afb3
commit
2bfc72e65e
|
@ -175,7 +175,7 @@ raw_ostream &raw_ostream::operator<<(const format_object_base &Fmt) {
|
|||
unsigned BytesUsed = Fmt.print(&V[0], NextBufferSize);
|
||||
|
||||
// If BytesUsed fit into the vector, we win.
|
||||
if (BytesUsed < NextBufferSize)
|
||||
if (BytesUsed <= NextBufferSize)
|
||||
return write(&V[0], BytesUsed);
|
||||
|
||||
// Otherwise, try again with a new size.
|
||||
|
|
Loading…
Reference in New Issue