summaryrefslogtreecommitdiff
path: root/userland
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-24 14:42:55 +0200
committerAnton Kling <anton@kling.gg>2023-10-24 14:42:55 +0200
commit11292853de086dce7d443d5f80bf5a0e8ffc0335 (patch)
tree8727bacd24699c44779681c460eb0b36e71592e0 /userland
parent3f06662e22732c45948a9ebf5a330b2505f418d0 (diff)
ante: Truncate the file before writing to it.
Previously the file size would not decrease even if data was deleted.
Diffstat (limited to 'userland')
-rw-r--r--userland/ante/ante.c1
1 files changed, 1 insertions, 0 deletions
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);
}