tRemeber to truncate datafile in datasave() in case it shrinks - ratox - FIFO based tox client
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit f7f067f23e6daf13a727fa81759e8dd72b167bb2
(DIR) parent 688f6b04c0d6e818bf8c2c3a38e202ca39320669
(HTM) Author: sin <sin@2f30.org>
Date: Mon, 22 Sep 2014 16:06:30 +0100
Remeber to truncate datafile in datasave() in case it shrinks
Diffstat:
M ratox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/ratox.c b/ratox.c
t@@ -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);