diff src/audio/SDL_audio.c @ 1379:c0a74f199ecf

Use only safe string functions
author Sam Lantinga <slouken@libsdl.org>
date Sun, 19 Feb 2006 23:46:34 +0000
parents 19418e4422cb
children d910939febfa
line wrap: on
line diff
--- a/src/audio/SDL_audio.c	Sun Feb 19 23:38:57 2006 +0000
+++ b/src/audio/SDL_audio.c	Sun Feb 19 23:46:34 2006 +0000
@@ -373,8 +373,7 @@
 char *SDL_AudioDriverName(char *namebuf, int maxlen)
 {
 	if ( current_audio != NULL ) {
-		SDL_strncpy(namebuf, current_audio->name, maxlen-1);
-		namebuf[maxlen-1] = '\0';
+		SDL_strlcpy(namebuf, current_audio->name, maxlen);
 		return(namebuf);
 	}
 	return(NULL);