/* test_cuesheet - Simple tester for cuesheet routines in grabbag
- * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Josh Coalson
+ * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#if HAVE_CONFIG_H
FLAC__metadata_object_delete(cuesheet);
return 1;
}
- sprintf(tmpfilename, "%s.1", infilename);
+ flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.1", infilename);
if(0 == (fout = fopen(tmpfilename, "w"))) {
fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
FLAC__metadata_object_delete(cuesheet);
FLAC__metadata_object_delete(cuesheet);
return 1;
}
- sprintf(tmpfilename, "%s.2", infilename);
+ flac_snprintf(tmpfilename, sizeof (tmpfilename), "%s.2", infilename);
if(0 == (fout = fopen(tmpfilename, "w"))) {
fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno));
FLAC__metadata_object_delete(cuesheet);
int main(int argc, char *argv[])
{
FLAC__uint64 lead_out_offset;
- unsigned sample_rate;
+ unsigned sample_rate = 48000;
FLAC__bool is_cdda = false;
const char *usage = "usage: test_cuesheet cuesheet_file lead_out_offset [ [ sample_rate ] cdda ]\n";
if(argc > 1 && 0 == strcmp(argv[1], "-h")) {
- printf(usage);
+ puts(usage);
return 0;
}
if(argc < 3 || argc > 5) {
- fprintf(stderr, usage);
+ fputs(usage, stderr);
return 255;
}
if(0 == strcmp(argv[4], "cdda"))
is_cdda = true;
else {
- fprintf(stderr, usage);
+ fputs(usage, stderr);
return 255;
}
}