src/cdrom/osf/SDL_syscdrom.c
changeset 1336 3692456e7b0f
parent 1019 e3b3130f3af8
child 1338 604d73db6802
--- a/src/cdrom/osf/SDL_syscdrom.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/cdrom/osf/SDL_syscdrom.c	Tue Feb 07 06:59:48 2006 +0000
@@ -125,13 +125,13 @@
 
 	/* Add this drive to our list */
 	i = SDL_numcds;
-	SDL_cdlist[i] = (char *)malloc(strlen(drive)+1);
+	SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(drive)+1);
 	if ( SDL_cdlist[i] == NULL ) {
 	    SDL_OutOfMemory();
 	    return;
 	}
 
-	strcpy(SDL_cdlist[i], drive);
+	SDL_strcpy(SDL_cdlist[i], drive);
 	SDL_cdmode[i] = stbuf->st_rdev;
 	++SDL_numcds;
 #ifdef DEBUG_CDROM
@@ -177,15 +177,15 @@
 
 
     /* Look in the environment for our CD-ROM drive list */
-    SDLcdrom = getenv("SDL_CDROM");	/* ':' separated list of devices */
+    SDLcdrom = SDL_getenv("SDL_CDROM");	/* ':' separated list of devices */
     if ( SDLcdrom != NULL ) {
 	char *cdpath, *delim;
-	cdpath = malloc(strlen(SDLcdrom)+1);
+	cdpath = SDL_malloc(SDL_strlen(SDLcdrom)+1);
 	if ( cdpath != NULL ) {
-	    strcpy(cdpath, SDLcdrom);
+	    SDL_strcpy(cdpath, SDLcdrom);
 	    SDLcdrom = cdpath;
 	    do {
-		delim = strchr(SDLcdrom, ':');
+		delim = SDL_strchr(SDLcdrom, ':');
 		if ( delim ) {
 		    *delim++ = '\0';
 		}
@@ -198,7 +198,7 @@
 		    SDLcdrom = NULL;
 		}
 	    } while ( SDLcdrom );
-	    free(cdpath);
+	    SDL_free(cdpath);
 	}
 
 	/* If we found our drives, there's nothing left to do */
@@ -214,9 +214,9 @@
 
 	devdir = opendir(checklist[i].dir);
 	if (devdir) {
-	    name_len = strlen(checklist[i].name);
+	    name_len = SDL_strlen(checklist[i].name);
 	    while (devent = readdir(devdir))
-		if (memcmp(checklist[i].name, devent->d_name, name_len) == 0)
+		if (SDL_memcmp(checklist[i].name, devent->d_name, name_len) == 0)
 		    if (devent->d_name[devent->d_namlen-1] == 'c') {
 			sprintf(drive, "%s/%s", checklist[i].dir, devent->d_name);
 #ifdef DEBUG_CDROM
@@ -234,8 +234,8 @@
     }
 
 /*
-    SDLcdrom=malloc(sizeof(char) * 32);
-    strcpy(SDLcdrom,"/dev/rdisk/cdrom0c");
+    SDLcdrom=SDL_malloc(sizeof(char) * 32);
+    SDL_strcpy(SDLcdrom,"/dev/rdisk/cdrom0c");
     SDL_cdlist[0] = SDLcdrom;
     stat(SDLcdrom, &stbuf);
     SDL_cdmode[0] = stbuf.st_rdev;
@@ -449,7 +449,7 @@
 
     if ( SDL_numcds > 0 ) {
 	for ( i=0; i<SDL_numcds; ++i ) {
-	    free(SDL_cdlist[i]);
+	    SDL_free(SDL_cdlist[i]);
 	}
 	SDL_numcds = 0;
     }