Skip to content

Commit

Permalink
Fixed bug 3883 - SDL_assert / SDL_PromptAssertion in TTY mode does no…
Browse files Browse the repository at this point in the history
…t accept options ("abriA")

shoerbaffen

fgets can read a newline and SDL_strcmp will never return zero.
  • Loading branch information
slouken committed Oct 16, 2017
1 parent f658a73 commit 8e98bda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SDL_assert.c
Expand Up @@ -278,19 +278,19 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata)
break;
}

if (SDL_strcmp(buf, "a") == 0) {
if (SDL_strncmp(buf, "a", 1) == 0) {
state = SDL_ASSERTION_ABORT;
break;
} else if (SDL_strcmp(buf, "b") == 0) {
} else if (SDL_strncmp(buf, "b", 1) == 0) {
state = SDL_ASSERTION_BREAK;
break;
} else if (SDL_strcmp(buf, "r") == 0) {
} else if (SDL_strncmp(buf, "r", 1) == 0) {
state = SDL_ASSERTION_RETRY;
break;
} else if (SDL_strcmp(buf, "i") == 0) {
} else if (SDL_strncmp(buf, "i", 1) == 0) {
state = SDL_ASSERTION_IGNORE;
break;
} else if (SDL_strcmp(buf, "A") == 0) {
} else if (SDL_strncmp(buf, "A", 1) == 0) {
state = SDL_ASSERTION_ALWAYS_IGNORE;
break;
}
Expand Down

0 comments on commit 8e98bda

Please sign in to comment.