comparison 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
comparison
equal deleted inserted replaced
1378:dc0e13e7e1ae 1379:c0a74f199ecf
92 msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */ 92 msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */
93 for (i=0; i<SDL_numcds; i++) 93 for (i=0; i<SDL_numcds; i++)
94 { 94 {
95 msp.ulNumber = i+1; 95 msp.ulNumber = i+1;
96 mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_NAME | MCI_WAIT,&msp, 0); 96 mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_NAME | MCI_WAIT,&msp, 0);
97 SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(SysInfoRet)+1); 97 SDL_cdlist[i] = SDL_strdup(SysInfoRet);
98 if ( SDL_cdlist[i] == NULL ) 98 if ( SDL_cdlist[i] == NULL )
99 { 99 {
100 SDL_OutOfMemory(); 100 SDL_OutOfMemory();
101 return(-1); 101 return(-1);
102 } 102 }
103 SDL_strcpy(SDL_cdlist[i], SysInfoRet);
104 } 103 }
105 return(0); 104 return(0);
106 } 105 }
107 106
108 /* Return CDAudio System Dependent Device Name - Ready for MCI*/ 107 /* Return CDAudio System Dependent Device Name - Ready for MCI*/