Skip to content

Commit d9b3a94

Browse files
mu5tafazadenikic
authored andcommitted
[NFC] Change strcpy to std::copy
Differential Revision: https://reviews.llvm.org/D146382
1 parent db8c0b2 commit d9b3a94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Object/COFFImportFile.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ static void writeStringTable(std::vector<uint8_t> &B,
8686

8787
for (const auto &S : Strings) {
8888
B.resize(Pos + S.length() + 1);
89-
strcpy(reinterpret_cast<char *>(&B[Pos]), S.c_str());
89+
std::copy(S.begin(), S.end(), std::next(B.begin(), Pos));
90+
B[Pos + S.length()] = 0;
9091
Pos += S.length() + 1;
9192
}
9293

0 commit comments

Comments
 (0)