Sophie

Sophie

distrib > Mandriva > 2010.2 > x86_64 > by-pkgid > e0ecf1de97625bd665ba6741f8b282d6 > files > 18

glibc-2.11.1-8mnb2.src.rpm

From 40ddeeb9fed93efef12e515e9b1740aee419d4b4 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@redhat.com>
Date: Mon, 25 Jan 2010 07:17:47 -0800
Subject: [PATCH 2/8] Fix error checking in iconv.
 (cherry picked from commit 7a518360023592882a7335b843ce1a5ea322dec5)

---
 ChangeLog          |    4 ++++
 iconv/iconv_prog.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2b7b746..d0d6218 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 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.7.0