[llvm-objcopy] [COFF] Avoid memcpy() with null parameters in more places. NFC.
commit9023451c39ed9306ccced36ec4a98c0ca16a6c38
authorMartin Storsjo <martin@martin.st>
Thu, 20 Dec 2018 21:35:59 +0000 (20 21:35 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 20 Dec 2018 21:35:59 +0000 (20 21:35 +0000)
tree0ae4f82cbf6a1ec28cc4ee3bffec8a58ea61f1e1
parentd446706e45f8ab5e2fc23c0909ddc3ae3c747a55
[llvm-objcopy] [COFF] Avoid memcpy() with null parameters in more places. NFC.

This fixes all cases of errors in asan+ubsan builds.

Also use std::copy instead of if+memcpy in the previously updated spot,
for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349826 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-objcopy/COFF/Writer.cpp