summaryrefslogtreecommitdiff
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
commit8c2ae4c603e78784c1e4887b39f6e12f01017cf7 (patch)
tree673fcb1cb12f9f9fe30c4db569d24b6ac7055e4a
parent53c8de3f31b87f6ceb83002bac8300350c01c3ba (diff)
downloadllvm-8c2ae4c603e78784c1e4887b39f6e12f01017cf7.tar.gz
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. llvm-svn: 58424
-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 008f85603eea..72aa1d33bc92 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.