src/events/SDL_events.c
changeset 7611 ed6f4b8557e4
parent 7306 1516fe08e6ec
child 7719 31b5f9ff36ca
child 8477 ad08f0d710f3
equal deleted inserted replaced
7610:b043c5c726c1 7611:ed6f4b8557e4
   597 Uint32
   597 Uint32
   598 SDL_RegisterEvents(int numevents)
   598 SDL_RegisterEvents(int numevents)
   599 {
   599 {
   600     Uint32 event_base;
   600     Uint32 event_base;
   601 
   601 
   602     if (SDL_userevents+numevents <= SDL_LASTEVENT) {
   602     if ((numevents > 0) && (SDL_userevents+numevents <= SDL_LASTEVENT)) {
   603         event_base = SDL_userevents;
   603         event_base = SDL_userevents;
   604         SDL_userevents += numevents;
   604         SDL_userevents += numevents;
   605     } else {
   605     } else {
   606         event_base = (Uint32)-1;
   606         event_base = (Uint32)-1;
   607     }
   607     }