Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mfterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ char* completion_sub_cmd_generator(const char* text, int state) {
++cmd_index;

// Extract command and sub-command
char buff[128];
strncpy(buff, name, sizeof(buff));
char buff[129];
strncpy(buff, name, sizeof(buff-1));
char* cmd = strtok(buff, " ");
char* sub = strtok(NULL, " ");

Expand Down Expand Up @@ -316,7 +316,7 @@ char* completion_spec_generator(const char* text, int state) {
continue;

char* fname = inst->field->name;
size_t fname_len = strlen(fname);
size_t fname_len = strlen(fname)+1;

// Check if the field is applicable - right prefix
if (fname_len >= parent_end_len &&
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


```suggestion
     if (fname_len >= parent_end_len &&😞

Expand Down