From 11292853de086dce7d443d5f80bf5a0e8ffc0335 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Tue, 24 Oct 2023 14:42:55 +0200 Subject: ante: Truncate the file before writing to it. Previously the file size would not decrease even if data was deleted. --- userland/ante/ante.c | 1 + 1 file changed, 1 insertion(+) diff --git a/userland/ante/ante.c b/userland/ante/ante.c index 003b03c..7fc1315 100644 --- a/userland/ante/ante.c +++ b/userland/ante/ante.c @@ -220,6 +220,7 @@ void draw_file(void) { void write_file(void) { assert(file_buffer); + assert(0 == ftruncate(file_fd, file_size)); pwrite(file_fd, file_buffer, file_size, 0); } -- cgit v1.2.3