iButton, RFID: rc-59 fixes (#1291)

* iButton: correct rename logic
* LFRFID: remove debug info, correct text
This commit is contained in:
SG
2022-06-02 22:56:03 +10:00
committed by GitHub
parent b625e84424
commit 40e3df9979
3 changed files with 6 additions and 18 deletions

View File

@@ -211,11 +211,12 @@ bool ibutton_save_key(iButton* ibutton, const char* key_name) {
bool result = false;
do {
// First remove key if it was saved (we rename the key)
ibutton_delete_key(ibutton);
// Set full file name, for new key
// Check if we has old key
if(string_end_with_str_p(ibutton->file_path, IBUTTON_APP_EXTENSION)) {
// First remove old key
ibutton_delete_key(ibutton);
// Remove old key name from path
size_t filename_start = string_search_rchar(ibutton->file_path, '/');
string_left(ibutton->file_path, filename_start);
}