mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
Correctly account for the Spaces array nul terminator. Thanks Chris!
llvm-svn: 79894
This commit is contained in:
parent
e9f6a3fcdc
commit
4fdc1f8e2d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user