From f61ca1eeda9cf2427047d83febe6fac1fbb1e84e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 26 Oct 2008 19:20:47 +0000 Subject: [PATCH] =?utf8?q?fix=20PR2953,=20an=20off-by-one=20error=20handli?= =?utf8?q?ng=20formatted=20i/o.=20Thanks=20to=20T=C3=B6r=C3=B6k=20Edwin=20?= =?utf8?q?for=20the=20awesome=20reduced=20testcase.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58199 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/raw_ostream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index a4c293660b0..8c704cb4714 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -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. -- 2.34.1