diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-04 06:19:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-04 06:19:43 +0000 |
commit | 21fb024cc017242b8082d2535053ed959fc0d0e8 (patch) | |
tree | 96783657c196257adc84c3cd418487a7614ed1b2 /llvm/lib/Archive | |
parent | cddbad000dcfb8e9cbdc9b95438b40c83357ed40 (diff) | |
download | bcm5719-llvm-21fb024cc017242b8082d2535053ed959fc0d0e8.tar.gz bcm5719-llvm-21fb024cc017242b8082d2535053ed959fc0d0e8.zip |
From PR6228:
"Attached patch removes the extra NUL bytes from the output and changes
test/Archive/MacOSX.toc from a binary to a text file (removes
svn:mime-type=application/octet-stream and adds svn:eol-style=native). I can't
figure out how to get SVN to include the new contents of the file in the patch
so I'm attaching it separately."
Patch by James Abbatiello!
llvm-svn: 95292
Diffstat (limited to 'llvm/lib/Archive')
-rw-r--r-- | llvm/lib/Archive/ArchiveReader.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Archive/ArchiveReader.cpp b/llvm/lib/Archive/ArchiveReader.cpp index a0c42b50167..3ef15d25d69 100644 --- a/llvm/lib/Archive/ArchiveReader.cpp +++ b/llvm/lib/Archive/ArchiveReader.cpp @@ -120,7 +120,8 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error) if (Hdr->name[1] == '1' && Hdr->name[2] == '/') { if (isdigit(Hdr->name[3])) { unsigned len = atoi(&Hdr->name[3]); - pathname.assign(At, len); + const char *nulp = (const char *)memchr(At, '\0', len); + pathname.assign(At, nulp != 0 ? nulp - At : len); At += len; MemberSize -= len; flags |= ArchiveMember::HasLongFilenameFlag; |