diff src/thread/linux/SDL_syssem.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/thread/linux/SDL_syssem.c	Tue Feb 07 07:03:29 2006 +0000
+++ b/src/thread/linux/SDL_syssem.c	Tue Feb 07 09:29:18 2006 +0000
@@ -20,7 +20,7 @@
     slouken@libsdl.org
 */
 
-#include <stdlib.h>
+#include "SDL_stdlib.h"
 #include "SDL_error.h"
 #include "SDL_thread.h"
 #include "SDL_timer.h"
@@ -46,9 +46,6 @@
 #include "generic/SDL_syssem.c"
 #else
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>			/* For getpid() */
 #include <pthread.h>
 #include <semaphore.h>
 
@@ -74,7 +71,7 @@
 		static int semnum = 0;
 		char name[32];
 
-		sprintf(name, "/SDL_sem-%d-%4.4d", getpid(), semnum++);
+		SDL_snprintf(name, SDL_arraysize(name), "/SDL_sem-%d-%4.4d", getpid(), semnum++);
 		sem->sem = sem_open(name, O_CREAT, 0600, initial_value);
 		if ( sem->sem == (sem_t *)SEM_FAILED ) {
 			SDL_SetError("sem_open(%s) failed", name);