[FL-1188] cli_print_version: fix garbage dereference and function signature

This commit is contained in:
あく 2021-04-22 01:43:18 +03:00 committed by GitHub
parent 0c0e5b6c6d
commit f7aeab7084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -71,16 +71,13 @@ void cli_print_version(const Version* version) {
}
void cli_motd() {
const Version* version;
printf("Flipper cli.\r\n");
version = (const Version*)api_hal_version_get_boot_version();
printf("Bootloader\r\n");
cli_print_version(version);
cli_print_version(api_hal_version_get_boot_version());
version = (const Version*)api_hal_version_get_fw_version();
printf("Firmware\r\n");
cli_print_version(version);
cli_print_version(api_hal_version_get_fw_version());
}
void cli_nl() {

View File

@ -29,7 +29,11 @@ void cli_command_help(string_t args, void* context) {
void cli_command_version(string_t args, void* context) {
(void)args;
(void)context;
cli_print_version();
printf("Bootloader\r\n");
cli_print_version(api_hal_version_get_boot_version());
printf("Firmware\r\n");
cli_print_version(api_hal_version_get_fw_version());
}
void cli_command_uuid(string_t args, void* context) {

View File

@ -39,6 +39,6 @@ struct Cli {
Cli* cli_alloc();
void cli_free(Cli* cli);
void cli_reset_state(Cli* cli);
void cli_print_version();
void cli_print_version(const Version* version);
void cli_putc(char c);
void cli_stdout_callback(void* _cookie, const char* data, size_t size);