[MPlayer-cvslog] r32776 - trunk/TOOLS/avisubdump.c
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Jan 9 23:05:03 CET 2011
On Sun, Jan 09, 2011 at 09:21:46PM +0100, siretart wrote:
> Modified: trunk/TOOLS/avisubdump.c
> ==============================================================================
> --- trunk/TOOLS/avisubdump.c Sun Jan 9 21:03:56 2011 (r32775)
> +++ trunk/TOOLS/avisubdump.c Sun Jan 9 21:21:45 2011 (r32776)
> @@ -180,8 +180,12 @@ int main(int argc,char* argv[])
> exit(1);
> }
>
> - if (strcmp(argv[argc-1], "-") == 0) f=stdin;
> - else f=fopen(argv[argc-1],"rb");
> + if (strcmp(argv[argc-1], "-") == 0) {
> + dump(stdin);
> + return 0;
> + }
> +
> + f=fopen(argv[argc-1],"rb");
>
> if (!f) {
> fprintf(stderr, "Could not open '%s': %s\n",
> @@ -190,6 +194,7 @@ int main(int argc,char* argv[])
> }
>
> dump(f);
> + fclose(f);
>
> return 0;
It's not an important tool, but I don't like added code duplication for no gain.
The fclose after all serves no purpose at all except satisfying such tools.
More information about the MPlayer-cvslog
mailing list