diff options
author | sin <sin@2f30.org> | 2014-09-22 16:06:30 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-09-22 16:06:30 +0100 |
commit | f7f067f23e6daf13a727fa81759e8dd72b167bb2 (patch) | |
tree | c0e7b87ae59ec8f16685facba48ed7c03e87b1de | |
parent | 688f6b04c0d6e818bf8c2c3a38e202ca39320669 (diff) |
Remeber to truncate datafile in datasave() in case it shrinks
-rw-r--r-- | ratox.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |