Use new function flac_snprintf() where ever appropriate.

This replaces un-safe usage of sprintf() and Micorsoft's _snprintf()
with something sane.
This commit is contained in:
Erik de Castro Lopo
2013-03-17 20:56:41 +11:00
parent 06af237c70
commit 3c84f9e86b
11 changed files with 30 additions and 48 deletions

View File

@@ -102,11 +102,7 @@ static FLAC__bool append_tag_(FLAC__StreamMetadata *block, const char *format, c
if (0 == saved_locale)
return false;
setlocale(LC_ALL, "C");
#if defined _MSC_VER || defined __MINGW32__
_snprintf(buffer, sizeof(buffer)-1, format, name, value);
#else
snprintf(buffer, sizeof(buffer)-1, format, name, value);
#endif
flac_snprintf(buffer, sizeof(buffer), format, name, value);
setlocale(LC_ALL, saved_locale);
free(saved_locale);