Skip to content

Commit

Permalink
fix setting parse bound checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Kethen committed Aug 1, 2024
1 parent b8b30c3 commit 92a0329
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void parse_config(){
char arg_buf[128] = {0};
u32 arg_buf_write_head = 0;
for(u32 i = 0;i <= len; i++){
if(len != sizeof(buf) && buf[i] != ' ' && buf[i] != '\n'){
if(i < len && buf[i] != ' ' && buf[i] != '\n'){
arg_buf[arg_buf_write_head] = buf[i];
arg_buf_write_head++;
}else{
Expand Down

0 comments on commit 92a0329

Please sign in to comment.