comparison libmpdemux/stream_dvd.c @ 18366:d18fc000093d

100000l to the fools who don't know C These were all found while auditing for malloc(A*B) type bugs. Removing them makes it easier to find real incorrect usage and makes the code more readable.
author rfelker
date Mon, 01 May 2006 02:04:09 +0000
parents 4231482179b6
children bee3186a06f7
comparison
equal deleted inserted replaced
18365:bdec1b4d8623 18366:d18fc000093d
516 if(!dvd_device) dvd_device=strdup(DEFAULT_DVD_DEVICE); 516 if(!dvd_device) dvd_device=strdup(DEFAULT_DVD_DEVICE);
517 #ifdef SYS_DARWIN 517 #ifdef SYS_DARWIN
518 /* Dynamic DVD drive selection on Darwin */ 518 /* Dynamic DVD drive selection on Darwin */
519 if(!strcmp(dvd_device, "/dev/rdiskN")) { 519 if(!strcmp(dvd_device, "/dev/rdiskN")) {
520 int i; 520 int i;
521 char *temp_device = malloc((strlen(dvd_device)+1)*sizeof(char)); 521 char *temp_device = malloc(strlen(dvd_device)+1);
522 522
523 for (i = 1; i < 10; i++) { 523 for (i = 1; i < 10; i++) {
524 sprintf(temp_device, "/dev/rdisk%d", i); 524 sprintf(temp_device, "/dev/rdisk%d", i);
525 dvd = DVDOpen(temp_device); 525 dvd = DVDOpen(temp_device);
526 if(!dvd) { 526 if(!dvd) {