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

Program exits on F5 trying to parse wrong flags #29

Open
paoloose opened this issue Feb 18, 2023 · 0 comments · May be fixed by #30
Open

Program exits on F5 trying to parse wrong flags #29

paoloose opened this issue Feb 18, 2023 · 0 comments · May be fixed by #30

Comments

@paoloose
Copy link

When restarting with F5, this for loop will try to parse_time all flags other than -p

sowon/main.c

Lines 238 to 253 in eb3a37c

case SDLK_F5: {
displayed_time = 0.0f;
paused = 0;
for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "-p") == 0) {
paused = 1;
} else {
displayed_time = parse_time(argv[i]);
}
}
if (paused) {
secc(SDL_SetTextureColorMod(digits, PAUSE_COLOR_R, PAUSE_COLOR_G, PAUSE_COLOR_B));
} else {
secc(SDL_SetTextureColorMod(digits, MAIN_COLOR_R, MAIN_COLOR_G, MAIN_COLOR_B));
}
} break;

So when running with -e or clock mode and hit F5, the application will close with '-e' is not a number and 'clock' is not a number respectively.

I will make a PR :)

@paoloose paoloose linked a pull request Feb 18, 2023 that will close this issue
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 a pull request may close this issue.

1 participant