src/cdrom/osf/SDL_syscdrom.c
changeset 1336 3692456e7b0f
parent 1019 e3b3130f3af8
child 1338 604d73db6802
     1.1 --- a/src/cdrom/osf/SDL_syscdrom.c	Mon Feb 06 17:28:04 2006 +0000
     1.2 +++ b/src/cdrom/osf/SDL_syscdrom.c	Tue Feb 07 06:59:48 2006 +0000
     1.3 @@ -125,13 +125,13 @@
     1.4  
     1.5  	/* Add this drive to our list */
     1.6  	i = SDL_numcds;
     1.7 -	SDL_cdlist[i] = (char *)malloc(strlen(drive)+1);
     1.8 +	SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(drive)+1);
     1.9  	if ( SDL_cdlist[i] == NULL ) {
    1.10  	    SDL_OutOfMemory();
    1.11  	    return;
    1.12  	}
    1.13  
    1.14 -	strcpy(SDL_cdlist[i], drive);
    1.15 +	SDL_strcpy(SDL_cdlist[i], drive);
    1.16  	SDL_cdmode[i] = stbuf->st_rdev;
    1.17  	++SDL_numcds;
    1.18  #ifdef DEBUG_CDROM
    1.19 @@ -177,15 +177,15 @@
    1.20  
    1.21  
    1.22      /* Look in the environment for our CD-ROM drive list */
    1.23 -    SDLcdrom = getenv("SDL_CDROM");	/* ':' separated list of devices */
    1.24 +    SDLcdrom = SDL_getenv("SDL_CDROM");	/* ':' separated list of devices */
    1.25      if ( SDLcdrom != NULL ) {
    1.26  	char *cdpath, *delim;
    1.27 -	cdpath = malloc(strlen(SDLcdrom)+1);
    1.28 +	cdpath = SDL_malloc(SDL_strlen(SDLcdrom)+1);
    1.29  	if ( cdpath != NULL ) {
    1.30 -	    strcpy(cdpath, SDLcdrom);
    1.31 +	    SDL_strcpy(cdpath, SDLcdrom);
    1.32  	    SDLcdrom = cdpath;
    1.33  	    do {
    1.34 -		delim = strchr(SDLcdrom, ':');
    1.35 +		delim = SDL_strchr(SDLcdrom, ':');
    1.36  		if ( delim ) {
    1.37  		    *delim++ = '\0';
    1.38  		}
    1.39 @@ -198,7 +198,7 @@
    1.40  		    SDLcdrom = NULL;
    1.41  		}
    1.42  	    } while ( SDLcdrom );
    1.43 -	    free(cdpath);
    1.44 +	    SDL_free(cdpath);
    1.45  	}
    1.46  
    1.47  	/* If we found our drives, there's nothing left to do */
    1.48 @@ -214,9 +214,9 @@
    1.49  
    1.50  	devdir = opendir(checklist[i].dir);
    1.51  	if (devdir) {
    1.52 -	    name_len = strlen(checklist[i].name);
    1.53 +	    name_len = SDL_strlen(checklist[i].name);
    1.54  	    while (devent = readdir(devdir))
    1.55 -		if (memcmp(checklist[i].name, devent->d_name, name_len) == 0)
    1.56 +		if (SDL_memcmp(checklist[i].name, devent->d_name, name_len) == 0)
    1.57  		    if (devent->d_name[devent->d_namlen-1] == 'c') {
    1.58  			sprintf(drive, "%s/%s", checklist[i].dir, devent->d_name);
    1.59  #ifdef DEBUG_CDROM
    1.60 @@ -234,8 +234,8 @@
    1.61      }
    1.62  
    1.63  /*
    1.64 -    SDLcdrom=malloc(sizeof(char) * 32);
    1.65 -    strcpy(SDLcdrom,"/dev/rdisk/cdrom0c");
    1.66 +    SDLcdrom=SDL_malloc(sizeof(char) * 32);
    1.67 +    SDL_strcpy(SDLcdrom,"/dev/rdisk/cdrom0c");
    1.68      SDL_cdlist[0] = SDLcdrom;
    1.69      stat(SDLcdrom, &stbuf);
    1.70      SDL_cdmode[0] = stbuf.st_rdev;
    1.71 @@ -449,7 +449,7 @@
    1.72  
    1.73      if ( SDL_numcds > 0 ) {
    1.74  	for ( i=0; i<SDL_numcds; ++i ) {
    1.75 -	    free(SDL_cdlist[i]);
    1.76 +	    SDL_free(SDL_cdlist[i]);
    1.77  	}
    1.78  	SDL_numcds = 0;
    1.79      }