diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-10-30 06:00:18 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-10-30 06:00:18 +0000 |
commit | 8c2ae4c603e78784c1e4887b39f6e12f01017cf7 (patch) | |
tree | 673fcb1cb12f9f9fe30c4db569d24b6ac7055e4a | |
parent | Merge from mainline. (diff) | |
download | llvm-project-8c2ae4c603e78784c1e4887b39f6e12f01017cf7.tar.gz llvm-project-8c2ae4c603e78784c1e4887b39f6e12f01017cf7.tar.bz2 llvm-project-8c2ae4c603e78784c1e4887b39f6e12f01017cf7.zip |
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.cpp | 2 |
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. |