1
0
mirror of https://github.com/biergaizi/codecrypt synced 2024-06-16 11:58:16 +00:00

keyring: write backup before actually touching keys

This commit is contained in:
Mirek Kratochvil 2017-06-26 14:30:07 +02:00
parent dc3a874cd5
commit ad40fbe5dc

@ -2,7 +2,7 @@
/*
* This file is part of Codecrypt.
*
* Copyright (C) 2013-2016 Mirek Kratochvil <exa.exa@gmail.com>
* Copyright (C) 2013-2017 Mirek Kratochvil <exa.exa@gmail.com>
*
* Codecrypt is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
@ -405,8 +405,8 @@ static bool file_put_sencode_with_backup (const std::string&fn, sencode*in,
std::string data = in->encode();
if (data == backup_data) return true; //nothing to do
return file_put_string (fn, data) &&
file_put_string (backup_fn, backup_data);
return file_put_string (backup_fn, backup_data) &&
file_put_string (fn, data);
}
#ifndef WIN32