mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
fix PR2953, an off-by-one error handling formatted i/o.
Thanks to Török Edwin for the awesome reduced testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58199 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
629b52697b
commit
f61ca1eeda
@ -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
Block a user