comparison 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
comparison
equal deleted inserted replaced
1378:dc0e13e7e1ae 1379:c0a74f199ecf
371 } 371 }
372 372
373 char *SDL_AudioDriverName(char *namebuf, int maxlen) 373 char *SDL_AudioDriverName(char *namebuf, int maxlen)
374 { 374 {
375 if ( current_audio != NULL ) { 375 if ( current_audio != NULL ) {
376 SDL_strncpy(namebuf, current_audio->name, maxlen-1); 376 SDL_strlcpy(namebuf, current_audio->name, maxlen);
377 namebuf[maxlen-1] = '\0';
378 return(namebuf); 377 return(namebuf);
379 } 378 }
380 return(NULL); 379 return(NULL);
381 } 380 }
382 381