summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-09-22 16:06:30 +0100
committersin <sin@2f30.org>2014-09-22 16:06:30 +0100
commitf7f067f23e6daf13a727fa81759e8dd72b167bb2 (patch)
treec0e7b87ae59ec8f16685facba48ed7c03e87b1de
parent688f6b04c0d6e818bf8c2c3a38e202ca39320669 (diff)
Remeber to truncate datafile in datasave() in case it shrinks
-rw-r--r--ratox.c2
1 files changed, 1 insertions, 1 deletions
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);