Skip to content

Conversation

@Oscar65
Copy link
Contributor

@Oscar65 Oscar65 commented Jul 1, 2025

Because getnstr hangs with input longer than 137 chars.

Because getnstr hangs with input longer than 137 chars.
void search_backward(void)
{
char *p, *string, tmp[BLOCK_SEARCH_SIZE], tmpstr[BLOCK_SEARCH_SIZE];
char *p, *string, tmp[BLOCK_SEARCH_SIZE], tmpstr[MAXLEN_SEARCH_STRING], tmpInput[MAXLEN_SEARCH_STRING];
Copy link
Collaborator

Choose a reason for hiding this comment

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

tmpstr size does not need any change, does it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why 137? why not LINE_MAX ?

ncurses 6.2 uses LINE_MAX or a larger (system-dependent) value provided by sysconf(3). If neither LINE_MAX nor sysconf is available, ncurses uses the POSIX minimum value for LINE_MAX (2048). In either case, it reserves a byte for the terminating null character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants