projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1eaf91
)
Correctly account for the Spaces array nul terminator. Thanks Chris!
author
Dan Gohman
<gohman@apple.com>
Mon, 24 Aug 2009 04:43:38 +0000
(
04:43
+0000)
committer
Dan Gohman
<gohman@apple.com>
Mon, 24 Aug 2009 04:43:38 +0000
(
04:43
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79894
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/raw_ostream.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/raw_ostream.cpp
b/lib/Support/raw_ostream.cpp
index 64d920503dc5bceba3f270ea0096a3fdca20fac1..230d9a81340c1d6fcd9234a70e6018d7e525cd6a 100644
(file)
--- a/
lib/Support/raw_ostream.cpp
+++ b/
lib/Support/raw_ostream.cpp
@@
-304,11
+304,12
@@
raw_ostream &raw_ostream::indent(unsigned NumSpaces) {
" ";
// Usually the indentation is small, handle it with a fastpath.
- if (NumSpaces <
=
array_lengthof(Spaces))
+ if (NumSpaces < array_lengthof(Spaces))
return write(Spaces, NumSpaces);
while (NumSpaces) {
- unsigned NumToWrite = std::min(NumSpaces, (unsigned)array_lengthof(Spaces));
+ unsigned NumToWrite = std::min(NumSpaces,
+ (unsigned)array_lengthof(Spaces)-1);
write(Spaces, NumToWrite);
NumSpaces -= NumToWrite;
}