Commit 94904260 authored by Michael Smith's avatar Michael Smith

Fix bug where oggenc would create an output filename identical to the input

filename, then accept it and truncate the input file.

Also fix an option default/bug that meant that "oggenc blah.wav" didn't work.


svn path=/trunk/vorbis-tools/; revision=6837
parent 37df37ba
......@@ -79,7 +79,7 @@ int main(int argc, char **argv)
oe_options opt = {NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL,
0, NULL, 0, NULL, 0, NULL, 0, 1, 0, 0,16,44100,2, 0, NULL,
DEFAULT_NAMEFMT_REMOVE, DEFAULT_NAMEFMT_REPLACE,
NULL, 0, -1,-1,-1,-.3,-1,0, 0,0.f, 0};
NULL, 0, -1,-1,-1,.3,-1,0, 0,0.f, 0};
int i;
......@@ -274,6 +274,13 @@ int main(int argc, char **argv)
continue;
}
if(infiles[i] && !strcmp(infiles[i], out_fn)) {
fprintf(stderr, _("ERROR: Input filename is the same as output filename \"%s\"\n"), out_fn);
errors++;
free(out_fn);
continue;
}
out = fopen(out_fn, "wb");
if(out == NULL)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment