aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils/src/ptgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/firmware-utils/src/ptgen.c')
-rw-r--r--tools/firmware-utils/src/ptgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c
index 8733e252cb..d94aabb5fc 100644
--- a/tools/firmware-utils/src/ptgen.c
+++ b/tools/firmware-utils/src/ptgen.c
@@ -143,7 +143,7 @@ static int gen_ptable(int nr)
printf("%ld\n", ((long) len * 512));
}
- if ((fd = open(filename, O_WRONLY|O_CREAT, 0644)) < 0) {
+ if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) {
fprintf(stderr, "Can't open output file '%s'\n",filename);
return -1;
}