diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-04-11 20:10:00 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-04-11 20:10:00 +0000 |
commit | caca482cde26129ae4ffa865ac8408ac06b1c9cf (patch) | |
tree | 07b179256e117e19e228ecec60e6f40b05eebdf7 /src | |
parent | 02b75108661d6f9cdc953ec8a4641d761cb26c18 (diff) | |
download | coreutils-caca482cde26129ae4ffa865ac8408ac06b1c9cf.tar.xz |
(main): Don't assume fopen returns stdout after closing
stdout. Use freopen instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/ptx.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -2154,9 +2154,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"), if (optind < argc) { - /* FIXME: don't fclose here? */ - fclose (stdout); - if (fopen (argv[optind], "w") == NULL) + if (! freopen (argv[optind], "w", stdout)) error (EXIT_FAILURE, errno, "%s", argv[optind]); optind++; } |