Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #37 in 4ZM/mfterm/master #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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