summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-26 19:20:47 +0000
committerChris Lattner <sabre@nondot.org>2008-10-26 19:20:47 +0000
commit2bfc72e65e8a55b3517fe12bc247a587ef12696f (patch)
treea8dc0b0c49d60e4649b552a0a796f74d16c726e3 /llvm/lib/Support/raw_ostream.cpp
parent5cba81afb36d14546f80dbc60ca72a5ac873d2fe (diff)
downloadbcm5719-llvm-2bfc72e65e8a55b3517fe12bc247a587ef12696f.tar.gz
bcm5719-llvm-2bfc72e65e8a55b3517fe12bc247a587ef12696f.zip
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
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index a4c293660b0..8c704cb4714 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud