Skip to content

Commit

Permalink
Make the list NULL terminated.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Sep 20, 2009
1 parent 2fabc34 commit 673bf57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/xbios/SDL_xbios.c
Expand Up @@ -522,7 +522,7 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
int j;

SDL_xbiosmode[i] = (xbiosmode_t **)
SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t *));
SDL_malloc((SDL_nummodes[i]+1)*sizeof(xbiosmode_t *));
if ( SDL_xbiosmode[i] == NULL ) {
SDL_OutOfMemory();
return(-1);
Expand All @@ -535,6 +535,7 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
}
SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t));
}
SDL_xbiosmode[i][j] = NULL;

SDL_modelist[i] = (SDL_Rect **)
SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
Expand Down

0 comments on commit 673bf57

Please sign in to comment.