diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-03-17 20:56:41 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-03-17 21:00:07 +1100 |
commit | 3c84f9e86b40b64bb42af6dff8c61521c5439ecd (patch) | |
tree | 0dc0434d74e18c324d8180386fc05170e2973df2 /src/metaflac | |
parent | 06af237c7008086a5389871320e5669dd51a0fdc (diff) | |
download | flac-3c84f9e86b40b64bb42af6dff8c61521c5439ecd.tar.gz |
Use new function flac_snprintf() where ever appropriate.
This replaces un-safe usage of sprintf() and Micorsoft's _snprintf()
with something sane.
Diffstat (limited to 'src/metaflac')
-rw-r--r-- | src/metaflac/operations_shorthand_cuesheet.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/metaflac/operations_shorthand_cuesheet.c b/src/metaflac/operations_shorthand_cuesheet.c index d59c1afd..f59bc899 100644 --- a/src/metaflac/operations_shorthand_cuesheet.c +++ b/src/metaflac/operations_shorthand_cuesheet.c @@ -21,7 +21,6 @@ #endif #include <errno.h> -#include <stdio.h> /* for snprintf() */ #include <string.h> #include "options.h" #include "utils.h" @@ -163,7 +162,7 @@ FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, for(track = 0; track < cs->num_tracks; track++) { const FLAC__StreamMetadata_CueSheet_Track *tr = cs->tracks+track; for(index = 0; index < tr->num_indices; index++) { - sprintf(spec, "%" PRIu64 ";", (tr->offset + tr->indices[index].offset)); + flac_snprintf(spec, sizeof (spec), "%" PRIu64 ";", (tr->offset + tr->indices[index].offset)); local_strcat(seekpoint_specification, spec); } } @@ -201,11 +200,7 @@ FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cueshe return false; } -#if defined _MSC_VER || defined __MINGW32__ - _snprintf(ref, reflen, "\"%s\" FLAC", filename); -#else - snprintf(ref, reflen, "\"%s\" FLAC", filename); -#endif + flac_snprintf(ref, reflen, "\"%s\" FLAC", filename); grabbag__cuesheet_emit(f, cuesheet, ref); |