[FL-1355] Fix flipper name C string (#485)

* api-hal-version: guarantee zero terminated flipper name
* cli_commands: fix hw_info command
This commit is contained in:
gornekich
2021-05-24 21:06:53 +03:00
committed by GitHub
parent f1e9a12eb0
commit 356476b7f8
6 changed files with 29 additions and 5 deletions

View File

@@ -102,7 +102,10 @@ void cli_command_hw_info(Cli* cli, string_t args, void* context) {
api_hal_version_get_hw_connect());
time_t time = api_hal_version_get_hw_timestamp();
printf("%-20s %s\r", "Production date:", ctime(&time));
printf("%-20s %s", "Name:", api_hal_version_get_name_ptr());
const char* name = api_hal_version_get_name_ptr();
if(name) {
printf("%-20s %s", "Name:", name);
}
}
void cli_command_vibro(Cli* cli, string_t args, void* context) {