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

SDL_sscanf() fails to parse the input string on MSVC #8423

Closed
Wohlstand opened this issue Oct 22, 2023 · 1 comment · Fixed by #8432
Closed

SDL_sscanf() fails to parse the input string on MSVC #8423

Wohlstand opened this issue Oct 22, 2023 · 1 comment · Fixed by #8432

Comments

@Wohlstand
Copy link
Contributor

Wohlstand commented Oct 22, 2023

Hello!

Recently I found that SDL_sscanf() is unable to parse some strings, and it always returns zero, and no output data filled. Possibly, it doesn't understands the [ ] syntax.

I attached a simple demo that performs the parsing of an input string example and builds two executables:

  • Without SDL (using system-wide sscanf())
  • With SDL

scanf-test.zip - the sscanf demo

Please edit CMakeLists.txt and set proper paths to SDL2 directory.

I didn't tested out the SDL3 yet, so, I don't know how it behaves on it, I tested only SDL2.

The thing works just fine on MinGW-w64, on Linux, on macOS, on Android, etc. On Windows's MSVC, it fails.

slouken added a commit to slouken/SDL that referenced this issue Oct 24, 2023
slouken added a commit that referenced this issue Oct 25, 2023
slouken added a commit that referenced this issue Oct 25, 2023
Fixes #8423

(cherry picked from commit 39a961b)
slouken added a commit that referenced this issue Oct 25, 2023
Fixes #8423

(cherry picked from commit 39a961b)
(cherry picked from commit 4194a90)
@Wohlstand
Copy link
Contributor Author

Thanks!
I'll try to check this out on my end.

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