mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 19:08:36 -07:00
Merge remote-tracking branch 'ofw/dev' into mntm-dev
This commit is contained in:
@@ -185,7 +185,7 @@ bool ibutton_load_key(iButton* ibutton, bool show_error) {
|
||||
FuriString* tmp = furi_string_alloc();
|
||||
|
||||
path_extract_filename(ibutton->file_path, tmp, true);
|
||||
strncpy(ibutton->key_name, furi_string_get_cstr(tmp), IBUTTON_KEY_NAME_SIZE);
|
||||
strlcpy(ibutton->key_name, furi_string_get_cstr(tmp), IBUTTON_KEY_NAME_SIZE);
|
||||
|
||||
furi_string_free(tmp);
|
||||
} else if(show_error) {
|
||||
@@ -245,7 +245,7 @@ bool ibutton_delete_key(iButton* ibutton) {
|
||||
}
|
||||
|
||||
void ibutton_reset_key(iButton* ibutton) {
|
||||
memset(ibutton->key_name, 0, IBUTTON_KEY_NAME_SIZE + 1);
|
||||
ibutton->key_name[0] = '\0';
|
||||
furi_string_reset(ibutton->file_path);
|
||||
ibutton_key_reset(ibutton->key);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#define IBUTTON_APP_FILENAME_PREFIX "iBtn"
|
||||
#define IBUTTON_APP_FILENAME_EXTENSION ".ibtn"
|
||||
|
||||
#define IBUTTON_KEY_NAME_SIZE 29
|
||||
#define IBUTTON_KEY_NAME_SIZE 30
|
||||
|
||||
typedef enum {
|
||||
iButtonWriteModeInvalid,
|
||||
@@ -56,7 +56,7 @@ struct iButton {
|
||||
iButtonWriteMode write_mode;
|
||||
|
||||
FuriString* file_path;
|
||||
char key_name[IBUTTON_KEY_NAME_SIZE + 1];
|
||||
char key_name[IBUTTON_KEY_NAME_SIZE];
|
||||
|
||||
Submenu* submenu;
|
||||
ByteInput* byte_input;
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
#define INFRARED_TEXT_STORE_NUM 2
|
||||
#define INFRARED_TEXT_STORE_SIZE 128
|
||||
|
||||
#define INFRARED_MAX_BUTTON_NAME_LENGTH 22
|
||||
#define INFRARED_MAX_REMOTE_NAME_LENGTH 22
|
||||
#define INFRARED_MAX_BUTTON_NAME_LENGTH 23
|
||||
#define INFRARED_MAX_REMOTE_NAME_LENGTH 23
|
||||
|
||||
#define INFRARED_APP_FOLDER EXT_PATH("infrared")
|
||||
#define INFRARED_APP_EXTENSION ".ir"
|
||||
|
||||
@@ -39,7 +39,7 @@ void infrared_scene_edit_rename_on_enter(void* context) {
|
||||
furi_check(current_button_index != InfraredButtonIndexNone);
|
||||
|
||||
enter_name_length = INFRARED_MAX_BUTTON_NAME_LENGTH;
|
||||
strncpy(
|
||||
strlcpy(
|
||||
infrared->text_store[0],
|
||||
infrared_remote_get_signal_name(remote, current_button_index),
|
||||
enter_name_length);
|
||||
@@ -47,7 +47,7 @@ void infrared_scene_edit_rename_on_enter(void* context) {
|
||||
} else if(edit_target == InfraredEditTargetRemote) {
|
||||
text_input_set_header_text(text_input, "Name the remote");
|
||||
enter_name_length = INFRARED_MAX_REMOTE_NAME_LENGTH;
|
||||
strncpy(infrared->text_store[0], infrared_remote_get_name(remote), enter_name_length);
|
||||
strlcpy(infrared->text_store[0], infrared_remote_get_name(remote), enter_name_length);
|
||||
|
||||
FuriString* folder_path;
|
||||
folder_path = furi_string_alloc();
|
||||
|
||||
@@ -63,7 +63,7 @@ void subghz_scene_save_name_on_enter(void* context) {
|
||||
furi_string_set(subghz->file_path, dir_name);
|
||||
}
|
||||
|
||||
strncpy(subghz->file_name_tmp, furi_string_get_cstr(file_name), SUBGHZ_MAX_LEN_NAME);
|
||||
strlcpy(subghz->file_name_tmp, furi_string_get_cstr(file_name), SUBGHZ_MAX_LEN_NAME);
|
||||
text_input_set_header_text(text_input, "Name signal");
|
||||
text_input_set_result_callback(
|
||||
text_input,
|
||||
|
||||
Reference in New Issue
Block a user