summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-01-25 07:17:47 -0800
committerPetr Baudis <pasky@ucw.cz>2010-05-12 01:40:00 +0200
commit4aa960e79da30982273b3e572e488c1de635cf53 (patch)
tree449b9dc30bad012256f016ebf012a1a5c4f0da74
parent2ce2bf1a9845ad1e0c5c3fa0bdd3601d95a78c45 (diff)
downloadglibc-4aa960e79da30982273b3e572e488c1de635cf53.tar.gz
glibc-4aa960e79da30982273b3e572e488c1de635cf53.tar.xz
glibc-4aa960e79da30982273b3e572e488c1de635cf53.zip
Fix error checking in iconv.
(cherry picked from commit 7a518360023592882a7335b843ce1a5ea322dec5)
-rw-r--r--ChangeLog4
-rw-r--r--iconv/iconv_prog.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cea6315b6c..47f2e529d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-25  Andreas Schwab  <schwab@redhat.com>
+
+	* iconv/iconv_prog.c (write_output): Fix check for open failure.
+
 2010-01-22  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11200]
diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
index a1ca05f153..3bcb9b464e 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