Use only safe string functions
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401383
This commit is contained in:
parent
a81db3ea34
commit
1da8cb0143
60 changed files with 223 additions and 263 deletions
|
@ -89,7 +89,7 @@ int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
|||
audiodev = audiopath;
|
||||
}
|
||||
if ( path != NULL ) {
|
||||
SDL_strncpy(path, audiodev, maxlen);
|
||||
SDL_strlcpy(path, audiodev, maxlen);
|
||||
path[maxlen-1] = '\0';
|
||||
}
|
||||
return(audio_fd);
|
||||
|
@ -136,7 +136,7 @@ static int OpenUserDefinedDevice(char *path, int maxlen, int flags)
|
|||
}
|
||||
audio_fd = open(audiodev, flags, 0);
|
||||
if ( path != NULL ) {
|
||||
SDL_strncpy(path, audiodev, maxlen);
|
||||
SDL_strlcpy(path, audiodev, maxlen);
|
||||
path[maxlen-1] = '\0';
|
||||
}
|
||||
return audio_fd;
|
||||
|
@ -166,8 +166,7 @@ int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
|||
audio_fd = open(audiopath, flags, 0);
|
||||
if ( audio_fd > 0 ) {
|
||||
if ( path != NULL ) {
|
||||
SDL_strncpy( path, audiopath, maxlen );
|
||||
path[maxlen-1] = '\0';
|
||||
SDL_strlcpy( path, audiopath, maxlen );
|
||||
}
|
||||
return audio_fd;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue