From 1ec753a440c3ab8cb0729007bd10364c24b86541 Mon Sep 17 00:00:00 2001 From: Linus Vogel Date: Sun, 15 Mar 2026 17:49:02 +0100 Subject: [PATCH] truncate file every iteration --- main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/main.c b/main.c index 5ad37d4..3474e90 100644 --- a/main.c +++ b/main.c @@ -67,6 +67,7 @@ int main(void) { total_jiffies_active = current_total_jiffies_active; total_jiffies_idle = current_total_jiffies_idle; + out_file = freopen(OUT_FILE, "w", out_file); fseek(out_file, 0, SEEK_SET); fprintf(out_file, "%.02f", utilization * 100); fflush(out_file);