From c50e4d2c3e9881185ab4e20c4a1217973bbffc92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9C=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=BA=D0=B5=D0=B2=D0=B8=D1=87?= Date: Mon, 26 Dec 2022 19:39:02 +0700 Subject: [PATCH] force rewrite of output files --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 81d0f46..58f584a 100644 --- a/main.c +++ b/main.c @@ -244,7 +244,7 @@ static int fdt_dump_node_attribute(char * fdt, char * strings, const char *attri snprintf(out_filename, 128, "./%s", outname); *strchr(out_filename, '@') = '_'; debug("Open file '%s'\n", out_filename); - fd = open(out_filename, O_WRONLY | O_CREAT, 0666); + fd = open(out_filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (fd < 0) { printf("Error: %d\n", errno);