public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix error checking in iconv
@ 2010-01-25 13:06 Andreas Schwab
  0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2010-01-25 13:06 UTC (permalink / raw)
  To: libc-hacker

2010-01-25  Andreas Schwab  <schwab@redhat.com>

	* iconv/iconv_prog.c (write_output): Fix check for open failure.

diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index a1ca05f..3bcb9b4 100644
--- a/iconv/iconv_prog.c
+++ b/iconv/iconv_prog.c
@@ -442,7 +442,7 @@ write_output (const char *outbuf, const char *outptr, FILE **output,
       if (output_file != NULL && strcmp (output_file, "-") != 0)
 	{
 	  *output = fopen (output_file, "w");
-	  if (output == NULL)
+	  if (*output == NULL)
 	    error (EXIT_FAILURE, errno, _("cannot open output file"));
 	}
       else
-- 
1.6.6


Andreas.

-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-25 13:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-25 13:06 [PATCH] Fix error checking in iconv Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).