mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-07 15:10:49 +00:00
Fix overflow when doing SDL_sscanf("%hd", ...)
An overflow occured in the stdlib_sscanf test, when using msys2 clang32 toolchain.
(cherry picked from commit 342ec51131)
This commit is contained in:
parent
f348370e1b
commit
10135b2d7b
1 changed files with 3 additions and 1 deletions
|
|
@ -1190,7 +1190,9 @@ int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
|||
suppress = SDL_TRUE;
|
||||
break;
|
||||
case 'h':
|
||||
if (inttype > DO_SHORT) {
|
||||
if (inttype == DO_INT) {
|
||||
inttype = DO_SHORT;
|
||||
} else if (inttype > DO_SHORT) {
|
||||
++inttype;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue