diff src/cdrom/os2/SDL_syscdrom.c @ 1379:c0a74f199ecf

Use only safe string functions
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 Feb 2006 23:46:34 +0000
parents 19418e4422cb
children d910939febfa
line wrap: on
line diff
--- a/src/cdrom/os2/SDL_syscdrom.c	Sun Feb 19 23:38:57 2006 +0000
+++ b/src/cdrom/os2/SDL_syscdrom.c	Sun Feb 19 23:46:34 2006 +0000
@@ -94,13 +94,12 @@
 	{
 	msp.ulNumber = i+1;
 	mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_NAME | MCI_WAIT,&msp, 0);
-	SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(SysInfoRet)+1);
+	SDL_cdlist[i] = SDL_strdup(SysInfoRet);
 	if ( SDL_cdlist[i] == NULL )
 		{
 		SDL_OutOfMemory();
 		return(-1);
 		}
-	SDL_strcpy(SDL_cdlist[i], SysInfoRet);
 	}
 return(0);
 }