aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils/src/add_header.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/firmware-utils/src/add_header.c')
-rw-r--r--tools/firmware-utils/src/add_header.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/firmware-utils/src/add_header.c b/tools/firmware-utils/src/add_header.c
index 946068c392..37775c3e0c 100644
--- a/tools/firmware-utils/src/add_header.c
+++ b/tools/firmware-utils/src/add_header.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
memcpy(buf, &header, sizeof(header));
// write the buf
- if ((fd = open(argv[3], O_CREAT|O_WRONLY,0644)) < 0
+ if ((fd = open(argv[3], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
|| write(fd, buf, buflen) != buflen
|| close(fd) < 0)
{