mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 02:38:35 -07:00
Storage: Updated virtual storage label to use strlcpy
This commit is contained in:
@@ -742,9 +742,9 @@ FS_Error storage_process_virtual_format(StorageData* storage) {
|
|||||||
SDError error = f_mkfs(sd_data->path, FM_ANY, 0, work, _MAX_SS);
|
SDError error = f_mkfs(sd_data->path, FM_ANY, 0, work, _MAX_SS);
|
||||||
storage_process_virtual_mount(storage);
|
storage_process_virtual_mount(storage);
|
||||||
const char* path = storage_file_get_path(mnt_image, mnt_image_storage);
|
const char* path = storage_file_get_path(mnt_image, mnt_image_storage);
|
||||||
char* label = basename(path);
|
const char* name = basename(path);
|
||||||
int len = strlen(label);
|
char label[strlen(name) - 3];
|
||||||
label[len - 4] = '\0'; // truncate the .img extension
|
strlcpy(label, name, sizeof(label));
|
||||||
f_setlabel(label);
|
f_setlabel(label);
|
||||||
storage_process_virtual_unmount(storage);
|
storage_process_virtual_unmount(storage);
|
||||||
free(work);
|
free(work);
|
||||||
|
|||||||
Reference in New Issue
Block a user