alex.kopachov 3 лет назад
Родитель
Сommit
1c572f6032
2 измененных файлов с 6 добавлено и 4 удалено
  1. 1 1
      docs/conf-file_description.md
  2. 5 3
      totp/cli/commands/add/add.c

+ 1 - 1
docs/conf-file_description.md

@@ -181,7 +181,7 @@ File format is standard for Flipper Zero device. Each line has one setting ident
 
 
 ```text
 ```text
 Filetype: Flipper TOTP plugin config file
 Filetype: Flipper TOTP plugin config file
-Version: 2
+Version: 3
 BaseIV: AD F2 DE F3 31 92 C8 77 4B EB BF FE 7D E1 27 51
 BaseIV: AD F2 DE F3 31 92 C8 77 4B EB BF FE 7D E1 27 51
 Crypto: FE CC 38 99 28 A9 28 6B BC E1 E3 92 B9 02 8A DF
 Crypto: FE CC 38 99 28 A9 28 6B BC E1 E3 92 B9 02 8A DF
 Timezone: 2.000000
 Timezone: 2.000000

+ 5 - 3
totp/cli/commands/add/add.c

@@ -38,7 +38,7 @@ static bool token_info_set_algo_from_str(TokenInfo* token_info, const FuriString
 
 
 static bool args_read_uint8_and_trim(FuriString* args, uint8_t* value) {
 static bool args_read_uint8_and_trim(FuriString* args, uint8_t* value) {
     int int_value;
     int int_value;
-    if (!args_read_int_and_trim(args, &int_value) || int_value < 0 || int_value > UINT8_MAX) {
+    if(!args_read_int_and_trim(args, &int_value) || int_value < 0 || int_value > UINT8_MAX) {
         return false;
         return false;
     }
     }
 
 
@@ -133,7 +133,8 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
                     "\"\r\n");
                     "\"\r\n");
             } else if(!token_info_set_digits_from_int(token_info, digit_value)) {
             } else if(!token_info_set_digits_from_int(token_info, digit_value)) {
                 TOTP_CLI_PRINTF(
                 TOTP_CLI_PRINTF(
-                    "\"%" PRIu8 "\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
+                    "\"%" PRIu8
+                    "\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
                     "\"\r\n",
                     "\"\r\n",
                     digit_value);
                     digit_value);
             } else {
             } else {
@@ -147,7 +148,8 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
                     "\"\r\n");
                     "\"\r\n");
             } else if(!token_info_set_duration_from_int(token_info, duration_value)) {
             } else if(!token_info_set_duration_from_int(token_info, duration_value)) {
                 TOTP_CLI_PRINTF(
                 TOTP_CLI_PRINTF(
-                    "\"%" PRIu8 "\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX
+                    "\"%" PRIu8
+                    "\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX
                     "\"\r\n",
                     "\"\r\n",
                     duration_value);
                     duration_value);
             } else {
             } else {