Skip to content

Commit 1a51c11

Browse files
committed
Clang format ran
1 parent 3a08fee commit 1a51c11

File tree

9 files changed

+114
-76
lines changed

9 files changed

+114
-76
lines changed

scenes/token_menu/totp_scene_token_menu.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ bool totp_scene_token_menu_handle_event(PluginEvent* const event, PluginState* p
139139
dialog_message_show(plugin_state->dialogs, message);
140140
dialog_message_free(message);
141141
if(dialog_result == DialogMessageButtonRight) {
142-
ListNode* list_node = list_element_at(plugin_state->tokens_list, scene_state->current_token_index);
142+
ListNode* list_node = list_element_at(
143+
plugin_state->tokens_list, scene_state->current_token_index);
143144

144145
TokenInfo* tokenInfo = list_node->data;
145146
token_info_free(tokenInfo);

services/cli/cli.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
#define TOTP_CLI_COMMAND_HELP "help"
1313

1414
static void totp_cli_print_unknown_command(FuriString* unknown_command) {
15-
TOTP_CLI_PRINTF("Command \"%s\" is unknown. Use \"help\" command to get list of available commands.", furi_string_get_cstr(unknown_command));
15+
TOTP_CLI_PRINTF(
16+
"Command \"%s\" is unknown. Use \"help\" command to get list of available commands.",
17+
furi_string_get_cstr(unknown_command));
1618
}
1719

1820
static void totp_cli_print_help() {
@@ -27,7 +29,7 @@ static void totp_cli_print_help() {
2729
}
2830

2931
static void totp_cli_handler(Cli* cli, FuriString* args, void* context) {
30-
PluginState* plugin_state = (PluginState* )context;
32+
PluginState* plugin_state = (PluginState*)context;
3133

3234
FuriString* cmd = furi_string_alloc();
3335

@@ -52,7 +54,8 @@ static void totp_cli_handler(Cli* cli, FuriString* args, void* context) {
5254

5355
void totp_cli_register_command_handler(PluginState* plugin_state) {
5456
Cli* cli = furi_record_open(RECORD_CLI);
55-
cli_add_command(cli, TOTP_CLI_COMMAND_NAME, CliCommandFlagParallelSafe, totp_cli_handler, plugin_state);
57+
cli_add_command(
58+
cli, TOTP_CLI_COMMAND_NAME, CliCommandFlagParallelSafe, totp_cli_handler, plugin_state);
5659
furi_record_close(RECORD_CLI);
5760
}
5861

services/cli/cli_common_helpers.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
#include <cli/cli.h>
33

44
void totp_cli_print_invalid_arguments() {
5-
TOTP_CLI_PRINTF("Invalid command arguments. use \"help\" command to get list of available commands");
5+
TOTP_CLI_PRINTF(
6+
"Invalid command arguments. use \"help\" command to get list of available commands");
67
}
78

89
bool totp_cli_ensure_authenticated(PluginState* plugin_state, Cli* cli) {
9-
if (plugin_state->current_scene == TotpSceneAuthentication) {
10+
if(plugin_state->current_scene == TotpSceneAuthentication) {
1011
TOTP_CLI_PRINTF("Pleases enter PIN on your flipper device\r\n");
11-
12-
while (plugin_state->current_scene == TotpSceneAuthentication && !cli_cmd_interrupt_received(cli)) {
12+
13+
while(plugin_state->current_scene == TotpSceneAuthentication &&
14+
!cli_cmd_interrupt_received(cli)) {
1315
furi_delay_tick(0);
1416
}
1517

1618
TOTP_CLI_PRINTF("\033[A\33[2K\r");
1719
fflush(stdout);
1820

19-
if (plugin_state->current_scene == TotpSceneAuthentication) {
21+
if(plugin_state->current_scene == TotpSceneAuthentication) {
2022
return false;
2123
}
2224
}

services/cli/cli_common_helpers.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#define TOTP_CLI_OPTIONAL_PARAM(param) "[" param "]"
88
#define TOTP_CLI_OPTIONAL_PARAM_MARK "[OPTIONAL]"
99

10-
#define TOTP_CLI_PRINTF(format, ...) \
11-
_Pragma(STRINGIFY(GCC diagnostic push)); \
10+
#define TOTP_CLI_PRINTF(format, ...) \
11+
_Pragma(STRINGIFY(GCC diagnostic push)); \
1212
_Pragma(STRINGIFY(GCC diagnostic ignored "-Wdouble-promotion")); \
13-
printf(format, ##__VA_ARGS__); \
13+
printf(format, ##__VA_ARGS__); \
1414
_Pragma(STRINGIFY(GCC diagnostic pop));
1515

1616
void totp_cli_print_invalid_arguments();

services/cli/commands/add/add.c

+50-32
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ static bool token_info_set_algo_from_str(TokenInfo* token_info, FuriString* str)
3131
if(furi_string_cmpi_str(str, TOTP_CONFIG_TOKEN_ALGO_SHA1_NAME) == 0) {
3232
token_info->algo = SHA1;
3333
return true;
34-
}
35-
34+
}
35+
3636
if(furi_string_cmpi_str(str, TOTP_CONFIG_TOKEN_ALGO_SHA256_NAME) == 0) {
3737
token_info->algo = SHA256;
3838
return true;
39-
}
40-
39+
}
40+
4141
if(furi_string_cmpi_str(str, TOTP_CONFIG_TOKEN_ALGO_SHA512_NAME) == 0) {
4242
token_info->algo = SHA512;
4343
return true;
@@ -47,11 +47,21 @@ static bool token_info_set_algo_from_str(TokenInfo* token_info, FuriString* str)
4747
}
4848

4949
void totp_cli_command_add_print_help() {
50-
TOTP_CLI_PRINTF("\t" TOTP_CLI_COMMAND_ADD " " TOTP_CLI_ARG(TOTP_CLI_COMMAND_ADD_ARG_NAME) " " TOTP_CLI_OPTIONAL_PARAM(TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX " " TOTP_CLI_ARG(TOTP_CLI_COMMAND_ADD_ARG_ALGO)) " " TOTP_CLI_OPTIONAL_PARAM(TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX " " TOTP_CLI_ARG(TOTP_CLI_COMMAND_ADD_ARG_DIGITS)) " " TOTP_CLI_OPTIONAL_PARAM(TOTP_CLI_COMMAND_ADD_ARG_UNSECURE_PREFIX) " - add new token\r\n");
50+
TOTP_CLI_PRINTF("\t" TOTP_CLI_COMMAND_ADD " " TOTP_CLI_ARG(TOTP_CLI_COMMAND_ADD_ARG_NAME) " " TOTP_CLI_OPTIONAL_PARAM(
51+
TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX " " TOTP_CLI_ARG(
52+
TOTP_CLI_COMMAND_ADD_ARG_ALGO)) " " TOTP_CLI_OPTIONAL_PARAM(TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
53+
" " TOTP_CLI_ARG(
54+
TOTP_CLI_COMMAND_ADD_ARG_DIGITS)) " " TOTP_CLI_OPTIONAL_PARAM(TOTP_CLI_COMMAND_ADD_ARG_UNSECURE_PREFIX) " - add new token\r\n");
5155
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_ARG(TOTP_CLI_COMMAND_ADD_ARG_NAME) " - token name\r\n");
52-
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_ARG(TOTP_CLI_COMMAND_ADD_ARG_ALGO) " - " TOTP_CLI_OPTIONAL_PARAM_MARK " token hashing algorithm, could be one of: sha1, sha256, sha512; default: sha1\r\n");
53-
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_ARG(TOTP_CLI_COMMAND_ADD_ARG_DIGITS) " - " TOTP_CLI_OPTIONAL_PARAM_MARK " number of digits to generate, one of: 6, 8; default: 6\r\n");
54-
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_COMMAND_ADD_ARG_UNSECURE_PREFIX " - " TOTP_CLI_OPTIONAL_PARAM_MARK " to show console user input as-is without masking; default: show masked\r\n\r\n");
56+
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_ARG(
57+
TOTP_CLI_COMMAND_ADD_ARG_ALGO) " - " TOTP_CLI_OPTIONAL_PARAM_MARK
58+
" token hashing algorithm, could be one of: sha1, sha256, sha512; default: sha1\r\n");
59+
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_ARG(
60+
TOTP_CLI_COMMAND_ADD_ARG_DIGITS) " - " TOTP_CLI_OPTIONAL_PARAM_MARK
61+
" number of digits to generate, one of: 6, 8; default: 6\r\n");
62+
TOTP_CLI_PRINTF(
63+
"\t\t" TOTP_CLI_COMMAND_ADD_ARG_UNSECURE_PREFIX " - " TOTP_CLI_OPTIONAL_PARAM_MARK
64+
" to show console user input as-is without masking; default: show masked\r\n\r\n");
5565
}
5666

5767
void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
@@ -61,7 +71,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
6171
TokenInfo* token_info = token_info_alloc();
6272

6373
// Reading token name
64-
if (!args_read_probably_quoted_string_and_trim(args, temp_str)) {
74+
if(!args_read_probably_quoted_string_and_trim(args, temp_str)) {
6575
totp_cli_print_invalid_arguments();
6676
furi_string_free(temp_str);
6777
token_info_free(token_info);
@@ -74,30 +84,39 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
7484

7585
// Read optional arguments
7686
bool mask_user_input = true;
77-
while (args_read_string_and_trim(args, temp_str)) {
87+
while(args_read_string_and_trim(args, temp_str)) {
7888
bool parsed = false;
79-
if (furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX) == 0) {
80-
if (!args_read_string_and_trim(args, temp_str)) {
81-
TOTP_CLI_PRINTF("Missed value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX "\"\r\n");
82-
} else if (!token_info_set_algo_from_str(token_info, temp_str)) {
83-
TOTP_CLI_PRINTF("\"%s\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX "\"\r\n", furi_string_get_cstr(temp_str));
89+
if(furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX) == 0) {
90+
if(!args_read_string_and_trim(args, temp_str)) {
91+
TOTP_CLI_PRINTF("Missed value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX
92+
"\"\r\n");
93+
} else if(!token_info_set_algo_from_str(token_info, temp_str)) {
94+
TOTP_CLI_PRINTF(
95+
"\"%s\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX
96+
"\"\r\n",
97+
furi_string_get_cstr(temp_str));
8498
} else {
8599
parsed = true;
86100
}
87-
} else if (furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX) == 0) {
88-
if (!args_read_string_and_trim(args, temp_str)) {
89-
TOTP_CLI_PRINTF("Missed value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX "\"\r\n");
90-
} else if (!token_info_set_digits_from_str(token_info, temp_str)) {
91-
TOTP_CLI_PRINTF("\"%s\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX "\"\r\n", furi_string_get_cstr(temp_str));
101+
} else if(furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX) == 0) {
102+
if(!args_read_string_and_trim(args, temp_str)) {
103+
TOTP_CLI_PRINTF(
104+
"Missed value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
105+
"\"\r\n");
106+
} else if(!token_info_set_digits_from_str(token_info, temp_str)) {
107+
TOTP_CLI_PRINTF(
108+
"\"%s\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
109+
"\"\r\n",
110+
furi_string_get_cstr(temp_str));
92111
} else {
93112
parsed = true;
94113
}
95-
} else if (furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_ADD_ARG_UNSECURE_PREFIX) == 0) {
114+
} else if(furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_ADD_ARG_UNSECURE_PREFIX) == 0) {
96115
mask_user_input = false;
97116
parsed = true;
98117
}
99118

100-
if (!parsed) {
119+
if(!parsed) {
101120
totp_cli_print_invalid_arguments();
102121
furi_string_free(temp_str);
103122
token_info_free(token_info);
@@ -111,7 +130,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
111130

112131
uint8_t c;
113132
while(cli_read(cli, &c, 1) == 1) {
114-
if (c == CliSymbolAsciiEsc) {
133+
if(c == CliSymbolAsciiEsc) {
115134
uint8_t c2;
116135
cli_read_timeout(cli, &c2, 1, 0);
117136
cli_read_timeout(cli, &c2, 1, 0);
@@ -121,36 +140,35 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
121140
token_info_free(token_info);
122141
return;
123142
} else if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
124-
if (mask_user_input) {
143+
if(mask_user_input) {
125144
putc('*', stdout);
126145
} else {
127146
putc(c, stdout);
128147
}
129148
fflush(stdout);
130149
furi_string_push_back(temp_str, c);
131-
} else if (c == CliSymbolAsciiBackspace || c == CliSymbolAsciiDel) {
150+
} else if(c == CliSymbolAsciiBackspace || c == CliSymbolAsciiDel) {
132151
size_t temp_str_size = furi_string_size(temp_str);
133-
if (temp_str_size > 0) {
152+
if(temp_str_size > 0) {
134153
TOTP_CLI_PRINTF("\b \b");
135154
fflush(stdout);
136155
furi_string_left(temp_str, temp_str_size - 1);
137156
}
138-
}
139-
else if(c == CliSymbolAsciiCR) {
157+
} else if(c == CliSymbolAsciiCR) {
140158
cli_nl();
141159
break;
142160
}
143161
}
144162

145163
temp_cstr = furi_string_get_cstr(temp_str);
146164

147-
if (!totp_cli_ensure_authenticated(plugin_state, cli)) {
165+
if(!totp_cli_ensure_authenticated(plugin_state, cli)) {
148166
furi_string_free(temp_str);
149167
token_info_free(token_info);
150168
return;
151169
}
152170

153-
if (!token_info_set_secret(token_info, temp_cstr, strlen(temp_cstr), plugin_state->iv)) {
171+
if(!token_info_set_secret(token_info, temp_cstr, strlen(temp_cstr), plugin_state->iv)) {
154172
TOTP_CLI_PRINTF("Token secret seems to be invalid and can not be parsed\r\n");
155173
furi_string_free(temp_str);
156174
token_info_free(token_info);
@@ -161,7 +179,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
161179
furi_string_free(temp_str);
162180

163181
bool load_generate_token_scene = false;
164-
if (plugin_state->current_scene == TotpSceneGenerateToken) {
182+
if(plugin_state->current_scene == TotpSceneGenerateToken) {
165183
totp_scene_director_activate_scene(plugin_state, TotpSceneNone, NULL);
166184
load_generate_token_scene = true;
167185
}
@@ -174,7 +192,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
174192
plugin_state->tokens_count++;
175193
totp_config_file_save_new_token(token_info);
176194

177-
if (load_generate_token_scene) {
195+
if(load_generate_token_scene) {
178196
totp_scene_director_activate_scene(plugin_state, TotpSceneGenerateToken, NULL);
179197
}
180198

services/cli/commands/delete/delete.c

+26-20
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,29 @@
1212
#define TOTP_CLI_COMMAND_DELETE_ARG_FORCE_SUFFIX "-f"
1313

1414
void totp_cli_command_delete_print_help() {
15-
TOTP_CLI_PRINTF("\t" TOTP_CLI_COMMAND_DELETE " " TOTP_CLI_ARG(TOTP_CLI_COMMAND_DELETE_ARG_INDEX) " " TOTP_CLI_OPTIONAL_PARAM(TOTP_CLI_COMMAND_DELETE_ARG_FORCE_SUFFIX) " - delete token\r\n");
16-
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_ARG(TOTP_CLI_COMMAND_DELETE_ARG_INDEX) " - token index in the list\r\n");
17-
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_COMMAND_DELETE_ARG_FORCE_SUFFIX " - " TOTP_CLI_OPTIONAL_PARAM_MARK " force command to do not ask user for interactive confirmation\r\n\r\n");
15+
TOTP_CLI_PRINTF(
16+
"\t" TOTP_CLI_COMMAND_DELETE
17+
" " TOTP_CLI_ARG(TOTP_CLI_COMMAND_DELETE_ARG_INDEX) " " TOTP_CLI_OPTIONAL_PARAM(
18+
TOTP_CLI_COMMAND_DELETE_ARG_FORCE_SUFFIX) " - delete token\r\n");
19+
TOTP_CLI_PRINTF(
20+
"\t\t" TOTP_CLI_ARG(TOTP_CLI_COMMAND_DELETE_ARG_INDEX) " - token index in the list\r\n");
21+
TOTP_CLI_PRINTF("\t\t" TOTP_CLI_COMMAND_DELETE_ARG_FORCE_SUFFIX
22+
" - " TOTP_CLI_OPTIONAL_PARAM_MARK
23+
" force command to do not ask user for interactive confirmation\r\n\r\n");
1824
}
1925

2026
void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
2127
int token_number;
22-
if (!args_read_int_and_trim(args, &token_number) || token_number <= 0 || token_number > plugin_state->tokens_count) {
28+
if(!args_read_int_and_trim(args, &token_number) || token_number <= 0 ||
29+
token_number > plugin_state->tokens_count) {
2330
totp_cli_print_invalid_arguments();
2431
return;
2532
}
2633

2734
FuriString* temp_str = furi_string_alloc();
2835
bool confirm_needed = true;
29-
if (args_read_string_and_trim(args, temp_str)) {
30-
if (furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_DELETE_ARG_FORCE_SUFFIX) == 0) {
36+
if(args_read_string_and_trim(args, temp_str)) {
37+
if(furi_string_cmpi_str(temp_str, TOTP_CLI_COMMAND_DELETE_ARG_FORCE_SUFFIX) == 0) {
3138
confirm_needed = false;
3239
} else {
3340
TOTP_CLI_PRINTF("Unknown argument \"%s\"\r\n", furi_string_get_cstr(temp_str));
@@ -38,7 +45,7 @@ void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args,
3845
}
3946
furi_string_free(temp_str);
4047

41-
if (!totp_cli_ensure_authenticated(plugin_state, cli)) {
48+
if(!totp_cli_ensure_authenticated(plugin_state, cli)) {
4249
return;
4350
}
4451

@@ -47,40 +54,39 @@ void totp_cli_command_delete_handle(PluginState* plugin_state, FuriString* args,
4754
TokenInfo* token_info = list_node->data;
4855

4956
bool confirmed = !confirm_needed;
50-
if (confirm_needed) {
57+
if(confirm_needed) {
5158
TOTP_CLI_PRINTF("WARNING!\r\n");
52-
TOTP_CLI_PRINTF("TOKEN \"%s\" WILL BE PERMANENTLY DELETED WITHOUT ABILITY TO RECOVER IT.\r\n", token_info->name);
59+
TOTP_CLI_PRINTF(
60+
"TOKEN \"%s\" WILL BE PERMANENTLY DELETED WITHOUT ABILITY TO RECOVER IT.\r\n",
61+
token_info->name);
5362
TOTP_CLI_PRINTF("Confirm? [y/n]\r\n");
5463
fflush(stdout);
5564
char user_pick;
5665
do {
5766
user_pick = tolower(cli_getc(cli));
58-
} while (user_pick != 'y' &&
59-
user_pick != 'n' &&
60-
user_pick != CliSymbolAsciiCR &&
61-
user_pick != CliSymbolAsciiETX &&
62-
user_pick != CliSymbolAsciiEsc);
67+
} while(user_pick != 'y' && user_pick != 'n' && user_pick != CliSymbolAsciiCR &&
68+
user_pick != CliSymbolAsciiETX && user_pick != CliSymbolAsciiEsc);
6369

6470
confirmed = user_pick == 'y' || user_pick == CliSymbolAsciiCR;
6571
}
6672

67-
if (confirmed) {
68-
if (!totp_cli_ensure_authenticated(plugin_state, cli)) {
73+
if(confirmed) {
74+
if(!totp_cli_ensure_authenticated(plugin_state, cli)) {
6975
return;
7076
}
7177

7278
bool activate_generate_token_scene = false;
73-
if (plugin_state->current_scene != TotpSceneAuthentication) {
79+
if(plugin_state->current_scene != TotpSceneAuthentication) {
7480
totp_scene_director_activate_scene(plugin_state, TotpSceneNone, NULL);
7581
activate_generate_token_scene = true;
7682
}
77-
83+
7884
plugin_state->tokens_list = list_remove(plugin_state->tokens_list, list_node);
7985
plugin_state->tokens_count--;
8086

8187
totp_full_save_config_file(plugin_state);
82-
83-
if (activate_generate_token_scene) {
88+
89+
if(activate_generate_token_scene) {
8490
totp_scene_director_activate_scene(plugin_state, TotpSceneGenerateToken, NULL);
8591
}
8692

services/cli/commands/list/list.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ void totp_cli_command_list_print_help() {
3434
}
3535

3636
void totp_cli_command_list_handle(PluginState* plugin_state, Cli* cli) {
37-
if (!totp_cli_ensure_authenticated(plugin_state, cli)) {
37+
if(!totp_cli_ensure_authenticated(plugin_state, cli)) {
3838
return;
3939
}
4040

41-
if (plugin_state->tokens_list == NULL) {
41+
if(plugin_state->tokens_list == NULL) {
4242
TOTP_CLI_PRINTF("There are no tokens");
4343
return;
4444
}
@@ -50,9 +50,14 @@ void totp_cli_command_list_handle(PluginState* plugin_state, Cli* cli) {
5050
TOTP_CLI_PRINTF("+-----+-----------------------------+--------+--------+\r\n");
5151
uint16_t index = 1;
5252
while(node != NULL) {
53-
TokenInfo* token_info = (TokenInfo* )node->data;
53+
TokenInfo* token_info = (TokenInfo*)node->data;
5454
token_info_get_digits_count(token_info);
55-
TOTP_CLI_PRINTF("| %-3" PRIu16 " | %-27.27s | %-6s | %-6" PRIu8 " |\r\n", index, token_info->name, get_algo_as_cstr(token_info->algo), get_digits_as_int(token_info->digits));
55+
TOTP_CLI_PRINTF(
56+
"| %-3" PRIu16 " | %-27.27s | %-6s | %-6" PRIu8 " |\r\n",
57+
index,
58+
token_info->name,
59+
get_algo_as_cstr(token_info->algo),
60+
get_digits_as_int(token_info->digits));
5661
node = node->next;
5762
index++;
5863
}

0 commit comments

Comments
 (0)