diff --git a/commands/ubi.c b/commands/ubi.c index 4c445d2..5e27584 100644 --- a/commands/ubi.c +++ b/commands/ubi.c @@ -42,7 +42,7 @@ return 1; } - fd_vol = open(argv[optind], O_WRONLY); + fd_vol = open(argv[optind], O_WRONLY | O_TRUNC); if (fd_vol < 0) { perror("open volume"); ret = 1;