[PATCH] D71119: [NFC][AIX][XCOFF] fixed compile warning on the strncpy.
Digger via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 09:25:33 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc04b63eccd5f: [NFC][AIX][XCOFF] fixed compile warning on the strncpy. (authored by DiggerLin).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71119/new/
https://reviews.llvm.org/D71119
Files:
llvm/lib/MC/XCOFFObjectWriter.cpp
Index: llvm/lib/MC/XCOFFObjectWriter.cpp
===================================================================
--- llvm/lib/MC/XCOFFObjectWriter.cpp
+++ llvm/lib/MC/XCOFFObjectWriter.cpp
@@ -416,7 +416,7 @@
W.write<int32_t>(0);
W.write<uint32_t>(Strings.getOffset(SymbolName));
} else {
- char Name[XCOFF::NameSize];
+ char Name[XCOFF::NameSize+1];
std::strncpy(Name, SymbolName.data(), XCOFF::NameSize);
ArrayRef<char> NameRef(Name, XCOFF::NameSize);
W.write(NameRef);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71119.232587.patch
Type: text/x-patch
Size: 502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191206/7f545827/attachment.bin>
More information about the llvm-commits
mailing list