diff src/cdrom/bsdi/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
line wrap: on
line diff
--- a/src/cdrom/bsdi/SDL_syscdrom.c	Tue Feb 07 07:03:29 2006 +0000
+++ b/src/cdrom/bsdi/SDL_syscdrom.c	Tue Feb 07 09:29:18 2006 +0000
@@ -29,18 +29,16 @@
 */
 
 #include <sys/types.h>
-#include <stdlib.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
 #include <err.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include </sys/dev/scsi/scsi.h>
 #include </sys/dev/scsi/scsi_ioctl.h>
 
+#include "SDL_stdlib.h"
+#include "SDL_string.h"
 #include "SDL_error.h"
 #include "SDL_cdrom.h"
 #include "SDL_syscdrom.h"
@@ -303,7 +301,7 @@
 			char *insert;
 			exists = 1;
 			for ( j=checklist[i][1]; exists; ++j ) {
-				sprintf(drive, "/dev/%sc", &checklist[i][3]);
+				SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
 				insert = SDL_strchr(drive, '?');
 				if ( insert != NULL ) {
 					*insert = j;
@@ -323,7 +321,7 @@
 				}
 			}
 		} else {
-			sprintf(drive, "/dev/%s", checklist[i]);
+			SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
 			if ( CheckDrive(drive, &stbuf) > 0 ) {
 				AddDrive(drive, &stbuf);
 			}