Skip to content
Snippets Groups Projects
Commit 62c7f660 authored by Ollie's avatar Ollie
Browse files

Update file cli.c

parent 489b2b87
No related branches found
No related tags found
No related merge requests found
...@@ -50,8 +50,10 @@ void execute_command(char *command) { ...@@ -50,8 +50,10 @@ void execute_command(char *command) {
size_t length = atoi(token); size_t length = atoi(token);
//Prepare the buffer and execute the read operation //Prepare the buffer and execute the read operation
uint8_t buffer[length]; uint8_t buffer[length + 1];
flash_read_safe(address, buffer, length); flash_read_safe(address, buffer, length);
buffer[length] = '\0';
printf("\nData: %s\n", buffer);
//Output the read data //Output the read data
printf("\nData: %s\n", buffer); printf("\nData: %s\n", buffer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment