summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ratox.c b/ratox.c
index 967d7f7..a82df8b 100644
--- a/ratox.c
+++ b/ratox.c
@@ -1006,9 +1006,9 @@ datasave(void)
if (!intermediate)
eprintf("malloc:");
tox_pass_encrypt(intermediate, sz - TOX_PASS_ENCRYPTION_EXTRA_LENGTH, passphrase, pplen, data, NULL);
+ } else {
+ data = intermediate;
}
- else
- memcpy(data, intermediate, sz);
if (write(fd, data, sz) != sz)
eprintf("write %s:", savefile);
fsync(fd);