summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ratox.c b/ratox.c
index bbff027..5d7c849 100644
--- a/ratox.c
+++ b/ratox.c
@@ -605,10 +605,15 @@ dataload(void)
exit(EXIT_FAILURE);
}
- if (tox_is_data_encrypted(data) ^ encryptsave) {
- fprintf(stderr, "Ensure %s matches your encryption configuration\n",
- DATAFILE);
- exit(EXIT_FAILURE);
+ if (encryptsave == 1) {
+ if (tox_is_data_encrypted(data) == 0)
+ encryptsave = 0;
+ } else {
+ if (tox_is_data_encrypted(data) == 1) {
+ fprintf(stderr, "Unable to load %s, it is encrypted\n",
+ DATAFILE);
+ exit(EXIT_FAILURE);
+ }
}
if (encryptsave == 1) {