From f7f067f23e6daf13a727fa81759e8dd72b167bb2 Mon Sep 17 00:00:00 2001 From: sin Date: Mon, 22 Sep 2014 16:06:30 +0100 Subject: Remeber to truncate datafile in datasave() in case it shrinks --- ratox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index f9400d5..80e5502 100644 --- a/ratox.c +++ b/ratox.c @@ -605,7 +605,7 @@ datasave(void) uint8_t *data; int fd; - fd = open(DATAFILE, O_WRONLY | O_CREAT , 0644); + fd = open(DATAFILE, O_WRONLY | O_TRUNC | O_CREAT , 0644); if (fd < 0) { perror("open"); exit(EXIT_FAILURE); -- cgit v1.2.3