mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Replace all calls to strncpy with strlcpy, use strdup more, expose strlcat (#3866)
strlcpy doesn't zero the buffer and ensures null termination, just like snprintf strlcat is already used by mjs and it's a safe alternative to strcat, so it should be OK to expose to apps
This commit is contained in:
@@ -99,7 +99,7 @@ static void furi_hal_version_set_name(const char* name) {
|
||||
"xFlipper %s",
|
||||
furi_hal_version.name);
|
||||
} else {
|
||||
snprintf(furi_hal_version.device_name, FURI_HAL_VERSION_DEVICE_NAME_LENGTH, "xFlipper");
|
||||
strlcpy(furi_hal_version.device_name, "xFlipper", FURI_HAL_VERSION_DEVICE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
furi_hal_version.device_name[0] = AD_TYPE_COMPLETE_LOCAL_NAME;
|
||||
|
||||
Reference in New Issue
Block a user