Skip to content

Commit 8b96e8a

Browse files
authored
[c] avoid not mandatory typecast (#35)
1 parent 03a8516 commit 8b96e8a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

embedded_cli.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ const char *embedded_cli_get_history(struct embedded_cli *cli,
136136
int history_pos)
137137
{
138138
#if EMBEDDED_CLI_HISTORY_LEN
139-
int pos = 0;
139+
size_t pos = 0;
140140

141141
if (history_pos < 0)
142142
return NULL;
143143

144144
// Search back through the history buffer for `history_pos` entry
145145
for (int i = 0; i < history_pos; i++) {
146-
int len = (int)strlen(&cli->history[pos]);
146+
size_t len = strlen(&cli->history[pos]);
147147
if (len == 0)
148148
return NULL;
149149
pos += len + 1;

0 commit comments

Comments
 (0)