tools: Avoid leaving extra data at the end of copied files
authorSimon Glass <sjg@chromium.org>
Fri, 12 Nov 2021 19:28:05 +0000 (12:28 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 26 Jan 2022 15:50:43 +0000 (08:50 -0700)
commit7ae46c35793bcc034f1300d8b79e3fd7e506537c
treec82d8c9bb34d430b5099c9b72a6bea7c52c7ae6d
parente291a5c9a2acff16ba3b976198bba7da9828c9e9
tools: Avoid leaving extra data at the end of copied files

The copyfile() implementation has strange behaviour if the destination
file already exists. Update it to ensure that any existing data in the
destination file is dropped.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/fit_common.c
tools/fit_common.h