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

A more improved check for the selected item in the "list" type dialog #976

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

f0Re3t
Copy link
Contributor

@f0Re3t f0Re3t commented Sep 3, 2024

The existing definition of the number of lines does not work well with repeated '\n', at the beginning of the line, at the end. A more improved version of determining the number of items in the dialog, eliminating all kinds of programmer errors.

For example, when passing the string "\n1\n2\n3\n", your algorithm will give the result 3, instead of the valid 2 (0, 1, 2). Thus, the cheater can send 3 in response, even though it is not in the dialog list.

@CLAassistant
Copy link

CLAassistant commented Sep 3, 2024

CLA assistant check
All committers have signed the CLA.

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