[llvm-objcopy] [COFF] Avoid memcpy() with null parameters in more places. NFC.
commit63574155b3f8d442dbaadf67884ec553309a5cad
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
parenta6798233f5e8268ca99fc4259a5b91f000a23388
[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