diff options
Diffstat (limited to 'lib/Object/Archive.cpp')
-rw-r--r-- | lib/Object/Archive.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index a1bd8b6c92..8bdab16c04 100644 --- a/lib/Object/Archive.cpp +++ b/lib/Object/Archive.cpp @@ -242,10 +242,9 @@ error_code Archive::Symbol::getMember(child_iterator &Result) const { Archive::Symbol Archive::Symbol::getNext() const { Symbol t(*this); - const char *buf = Parent->SymbolTable->getBuffer()->getBufferStart(); - buf += t.StringIndex; - while (*buf++); // Go to one past next null. - t.StringIndex = buf - Parent->SymbolTable->getBuffer()->getBufferStart(); + // Go to one past next null. + t.StringIndex = + Parent->SymbolTable->getBuffer()->getBuffer().find('\0', t.StringIndex) + 1; ++t.SymbolIndex; return t; } |