summaryrefslogtreecommitdiff
path: root/components/finsh/shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/finsh/shell.c')
-rw-r--r--components/finsh/shell.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index 5b96d0daf9..5398db5370 100644
--- a/components/finsh/shell.c
+++ b/components/finsh/shell.c
@@ -221,7 +221,7 @@ void finsh_set_device(const char *device_name)
}
/* clear line buffer before switch to new device */
- memset(shell->line, 0, sizeof(shell->line));
+ rt_memset(shell->line, 0, sizeof(shell->line));
shell->line_curpos = shell->line_position = 0;
shell->device = dev;
@@ -404,11 +404,11 @@ static void shell_push_history(struct finsh_shell *shell)
int index;
for (index = 0; index < FINSH_HISTORY_LINES - 1; index ++)
{
- memcpy(&shell->cmd_history[index][0],
+ rt_memcpy(&shell->cmd_history[index][0],
&shell->cmd_history[index + 1][0], FINSH_CMD_SIZE);
}
- memset(&shell->cmd_history[index][0], 0, FINSH_CMD_SIZE);
- memcpy(&shell->cmd_history[index][0], shell->line, shell->line_position);
+ rt_memset(&shell->cmd_history[index][0], 0, FINSH_CMD_SIZE);
+ rt_memcpy(&shell->cmd_history[index][0], shell->line, shell->line_position);
/* it's the maximum history */
shell->history_count = FINSH_HISTORY_LINES;
@@ -420,8 +420,8 @@ static void shell_push_history(struct finsh_shell *shell)
if (shell->history_count == 0 || memcmp(&shell->cmd_history[shell->history_count - 1], shell->line, FINSH_CMD_SIZE))
{
shell->current_history = shell->history_count;
- memset(&shell->cmd_history[shell->history_count][0], 0, FINSH_CMD_SIZE);
- memcpy(&shell->cmd_history[shell->history_count][0], shell->line, shell->line_position);
+ rt_memset(&shell->cmd_history[shell->history_count][0], 0, FINSH_CMD_SIZE);
+ rt_memcpy(&shell->cmd_history[shell->history_count][0], shell->line, shell->line_position);
/* increase count and set current history position */
shell->history_count ++;
@@ -517,7 +517,7 @@ void finsh_thread_entry(void *parameter)
}
/* copy the history command */
- memcpy(shell->line, &shell->cmd_history[shell->current_history][0],
+ rt_memcpy(shell->line, &shell->cmd_history[shell->current_history][0],
FINSH_CMD_SIZE);
shell->line_curpos = shell->line_position = strlen(shell->line);
shell_handle_history(shell);
@@ -539,7 +539,7 @@ void finsh_thread_entry(void *parameter)
continue;
}
- memcpy(shell->line, &shell->cmd_history[shell->current_history][0],
+ rt_memcpy(shell->line, &shell->cmd_history[shell->current_history][0],
FINSH_CMD_SIZE);
shell->line_curpos = shell->line_position = strlen(shell->line);
shell_handle_history(shell);
@@ -630,7 +630,7 @@ void finsh_thread_entry(void *parameter)
msh_exec(shell->line, shell->line_position);
rt_kprintf(FINSH_PROMPT);
- memset(shell->line, 0, sizeof(shell->line));
+ rt_memset(shell->line, 0, sizeof(shell->line));
shell->line_curpos = shell->line_position = 0;
continue;
}