aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2008-10-30 06:00:18 +0000
committerTanya Lattner <tonic@nondot.org>2008-10-30 06:00:18 +0000
commitf22c0a175da431dafc9323604ae2788b9208fab5 (patch)
treea368ef0a2c1f62acdbbcbd6895107fc6f091b347
parent83d348295e42d14dec2a6b7d53359b57b4db7bd1 (diff)
Merge from mainline.
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/branches/release_24@58424 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Support/raw_ostream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index 008f85603e..72aa1d33bc 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.