[lld] r194877 - Replace magic number with sizeof(). No functionality change.
Rui Ueyama
ruiu at google.com
Fri Nov 15 15:11:00 PST 2013
Author: ruiu
Date: Fri Nov 15 17:11:00 2013
New Revision: 194877
URL: http://llvm.org/viewvc/llvm-project?rev=194877&view=rev
Log:
Replace magic number with sizeof(). No functionality change.
Modified:
lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
Modified: lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp?rev=194877&r1=194876&r2=194877&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/WriterNative.cpp Fri Nov 15 17:11:00 2013
@@ -174,7 +174,8 @@ private:
NativeChunk *chunks =
reinterpret_cast<NativeChunk*>(reinterpret_cast<char*>(_headerBuffer)
+ sizeof(NativeFileHeader));
- memcpy(_headerBuffer->magic, NATIVE_FILE_HEADER_MAGIC, 16);
+ memcpy(_headerBuffer->magic, NATIVE_FILE_HEADER_MAGIC,
+ sizeof(_headerBuffer->magic));
_headerBuffer->endian = NFH_LittleEndian;
_headerBuffer->architecture = 0;
_headerBuffer->fileSize = 0;
More information about the llvm-commits
mailing list