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

Cheat commands always (falsely) ON & Undefined behavior if CTRL+D is pressed #67

Open
Kuninoto opened this issue Feb 21, 2023 · 0 comments

Comments

@Kuninoto
Copy link
Contributor

Kuninoto commented Feb 21, 2023

Hello there!,
While trying to force grademe to give me do_op ex (in the ambience of trying to fix issue #61)
I've noticed that entering the settings command the cheat commands are always ON and I cannot use any of them (force_success for example).

Also I've noticed that because you're using readline if in the settings menu I send the EOT signal i.e CTRL+D it enters an infinite loop where I can't write anymore. To solve that, in every read and evaluate loop you should check for EOF on the cin stream and if you find it it's because a CTRL+D was pressed. Bellow I'll leave a MRE of the checks that should be on the read and evaluate loop.

if (cin.eof() == true) { cin.clear(); clearerr(stdin); }

@Kuninoto Kuninoto changed the title Cheat commands always (falsely) ON & Undefined behavior Cheat commands always (falsely) ON & Undefined behavior if CTRL+D is pressed Feb 21, 2023
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

No branches or pull requests

1 participant