Mercurial > sdl-ios-xcode
diff src/audio/SDL_audiodev.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/audio/SDL_audiodev.c Tue Feb 07 07:03:29 2006 +0000 +++ b/src/audio/SDL_audiodev.c Tue Feb 07 09:29:18 2006 +0000 @@ -24,13 +24,12 @@ #if defined(unix) || defined(__unix__) || defined(__riscos__) -#include <stdlib.h> -#include <stdio.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> -#include <string.h> +#include "SDL_stdlib.h" +#include "SDL_string.h" #include "SDL_audiodev_c.h" #ifndef _PATH_DEV_DSP @@ -80,7 +79,8 @@ instance = 1; do { /* Don't use errno ENOENT - it may not be thread-safe */ - sprintf(audiopath, "%s%d", audiodev, instance++); + SDL_snprintf(audiopath, SDL_arraysize(audiopath), + "%s%d", audiodev, instance++); exists = 0; if ( stat(audiopath, &sb) == 0 ) { exists = 1; @@ -100,11 +100,11 @@ /* Get the name of the audio device we use for output */ -#include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> -#include <string.h> +#include "SDL_stdlib.h" +#include "SDL_string.h" #include "SDL_audiodev_c.h" #ifndef _PATH_DEV_DSP @@ -158,7 +158,7 @@ cycle = 0; while( devsettings[cycle][0] != '\0' ) { - sprintf( audiopath, + SDL_snprintf( audiopath, SDL_arraysize(audiopath), _PATH_DEV_DSP, devsettings[cycle][0], devsettings[cycle][1],