diff --git a/include/SDL2/SDL_hints.h b/include/SDL2/SDL_hints.h index 6d66709..4e37063 100644 --- a/include/SDL2/SDL_hints.h +++ b/include/SDL2/SDL_hints.h @@ -2283,7 +2283,7 @@ extern "C" { /** * A variable controlling whether the libdecor Wayland backend is preferred - * over native decrations. + * over native decorations. * * When this hint is set, libdecor will be used to provide window decorations, * even if xdg-decoration is available. (Note that, by default, libdecor will diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index 45468f3..ee58b28 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -153,10 +153,10 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) { Sint64 min = pMin; Sint64 max = pMax; - Sint64 temp; - Sint64 number; + Uint64 range; if (pMin > pMax) { + Sint32 temp; temp = min; min = max; max = temp; @@ -164,10 +164,13 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) return (Sint32)min; } - number = SDLTest_RandomUint32(); - /* invocation count increment in preceeding call */ - - return (Sint32)((number % ((max + 1) - min)) + min); + range = (Sint64)max - (Sint64)min; + if (range < SDL_MAX_SINT32) { + return min + (Sint32) (SDLTest_RandomUint32() % (range + 1)); + } else { + Uint64 add = SDLTest_RandomUint32() | SDLTest_RandomUint32(); + return (Sint32) (min + (Sint64) (add % (range + 1))); + } } /* !