Mercurial > sdl-ios-xcode
comparison src/video/xbios/SDL_xbios.c @ 4202:7ec1d9a34164 SDL-1.2
Make the list NULL terminated.
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Sun, 20 Sep 2009 18:14:35 +0000 |
parents | b10a73ebd7fd |
children | 7b27a7fc4fdf |
comparison
equal
deleted
inserted
replaced
4201:b10a73ebd7fd | 4202:7ec1d9a34164 |
---|---|
520 | 520 |
521 for ( i=0; i<NUM_MODELISTS; ++i ) { | 521 for ( i=0; i<NUM_MODELISTS; ++i ) { |
522 int j; | 522 int j; |
523 | 523 |
524 SDL_xbiosmode[i] = (xbiosmode_t **) | 524 SDL_xbiosmode[i] = (xbiosmode_t **) |
525 SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t *)); | 525 SDL_malloc((SDL_nummodes[i]+1)*sizeof(xbiosmode_t *)); |
526 if ( SDL_xbiosmode[i] == NULL ) { | 526 if ( SDL_xbiosmode[i] == NULL ) { |
527 SDL_OutOfMemory(); | 527 SDL_OutOfMemory(); |
528 return(-1); | 528 return(-1); |
529 } | 529 } |
530 for ( j=0; j<SDL_nummodes[i]; ++j ) { | 530 for ( j=0; j<SDL_nummodes[i]; ++j ) { |
533 SDL_OutOfMemory(); | 533 SDL_OutOfMemory(); |
534 return(-1); | 534 return(-1); |
535 } | 535 } |
536 SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t)); | 536 SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t)); |
537 } | 537 } |
538 SDL_xbiosmode[i][j] = NULL; | |
538 | 539 |
539 SDL_modelist[i] = (SDL_Rect **) | 540 SDL_modelist[i] = (SDL_Rect **) |
540 SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *)); | 541 SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *)); |
541 if ( SDL_modelist[i] == NULL ) { | 542 if ( SDL_modelist[i] == NULL ) { |
542 SDL_OutOfMemory(); | 543 SDL_OutOfMemory(); |