comparison src/cdrom/qnx/SDL_syscdrom.c @ 1338:604d73db6802

Removed uses of stdlib.h and string.h
author Sam Lantinga <slouken@libsdl.org>
date Tue, 07 Feb 2006 09:29:18 +0000
parents 3692456e7b0f
children c71e05b4dc2e
comparison
equal deleted inserted replaced
1337:c687f06c7473 1338:604d73db6802
21 */ 21 */
22 22
23 /* Functions for system-level CD-ROM audio control */ 23 /* Functions for system-level CD-ROM audio control */
24 24
25 #include <sys/types.h> 25 #include <sys/types.h>
26 #include <stdlib.h>
27 #include <sys/stat.h> 26 #include <sys/stat.h>
28 #include <sys/ioctl.h> 27 #include <sys/ioctl.h>
29 #include <fcntl.h> 28 #include <fcntl.h>
30 #include <stdio.h>
31 #include <errno.h> 29 #include <errno.h>
32 #include <string.h>
33 #include <unistd.h> 30 #include <unistd.h>
34 #include <sys/cdrom.h> 31 #include <sys/cdrom.h>
35 #include <sys/dcmd_cam.h> 32 #include <sys/dcmd_cam.h>
36 33
34 #include "SDL_stdlib.h"
35 #include "SDL_string.h"
37 #include "SDL_error.h" 36 #include "SDL_error.h"
38 #include "SDL_cdrom.h" 37 #include "SDL_cdrom.h"
39 #include "SDL_timer.h" 38 #include "SDL_timer.h"
40 #include "SDL_syscdrom.h" 39 #include "SDL_syscdrom.h"
41 40
216 char* insert; 215 char* insert;
217 exists = 1; 216 exists = 1;
218 217
219 for ( j=checklist[i][1]; exists; ++j ) 218 for ( j=checklist[i][1]; exists; ++j )
220 { 219 {
221 sprintf(drive, "/dev/%s", &checklist[i][3]); 220 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
222 insert = SDL_strchr(drive, '?'); 221 insert = SDL_strchr(drive, '?');
223 if (insert != NULL) 222 if (insert != NULL)
224 { 223 {
225 *insert = j; 224 *insert = j;
226 } 225 }
240 } 239 }
241 } 240 }
242 } 241 }
243 else 242 else
244 { 243 {
245 sprintf(drive, "/dev/%s", checklist[i]); 244 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
246 if (CheckDrive(drive, &stbuf) > 0) 245 if (CheckDrive(drive, &stbuf) > 0)
247 { 246 {
248 AddDrive(drive, &stbuf); 247 AddDrive(drive, &stbuf);
249 } 248 }
250 } 249 }