This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.19-350-g4fdfe82


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  4fdfe821e20a70670b3d03deb2abed5d8c83e51b (commit)
      from  0cdddc25a47509262a9a55a343395971b492b0fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4fdfe821e20a70670b3d03deb2abed5d8c83e51b

commit 4fdfe821e20a70670b3d03deb2abed5d8c83e51b
Author: Andreas Schwab <schwab@linux-m68k.org>
Date:   Thu May 1 15:50:27 2014 +0200

    Correctly handle %p in wprintf (BZ #16890)

diff --git a/ChangeLog b/ChangeLog
index 08ec932..55724f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-05-01  Andreas Schwab  <schwab@linux-m68k.org>
+
+	[BZ #16890]
+	* stdio-common/vfprintf.c (process_arg) [%p]: Mark string as wide
+	when compiling wprintf.
+	* stdio-common/tstdiomisc.c (t3): New function.
+	(main): Call it.
+
 2014-05-01  Steve Ellcey  <sellcey@mips.com>
 
 	* intl/iconv/skeleton.c (ONE_DIRECTION): Remove define.
diff --git a/NEWS b/NEWS
index 5a690b8..f58437b 100644
--- a/NEWS
+++ b/NEWS
@@ -16,7 +16,7 @@ Version 2.20
   16677, 16680, 16683, 16689, 16695, 16701, 16706, 16707, 16712, 16713,
   16714, 16731, 16739, 16740, 16743, 16754, 16758, 16759, 16760, 16770,
   16786, 16789, 16791, 16799, 16800, 16815, 16823, 16824, 16831, 16838,
-  16854, 16888.
+  16854, 16888, 16890.
 
 * The minimum Linux kernel version that this version of the GNU C Library
   can be used with is 2.6.32.
diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
index 5a25ecc..2e0663a 100644
--- a/stdio-common/tstdiomisc.c
+++ b/stdio-common/tstdiomisc.c
@@ -46,6 +46,24 @@ t2 (void)
   return result;
 }
 
+static int
+t3 (void)
+{
+  char buf[80];
+  wchar_t wbuf[80];
+  int result = 0;
+  int retval;
+
+  retval = sprintf (buf, "%p", (char *) NULL);
+  result |= retval != 5 || strcmp (buf, "(nil)") != 0;
+
+  retval = swprintf (wbuf, sizeof (wbuf) / sizeof (wbuf[0]),
+		     L"%p", (char *) NULL);
+  result |= retval != 5 || wcscmp (wbuf, L"(nil)") != 0;
+
+  return result;
+}
+
 volatile double qnanval;
 volatile long double lqnanval;
 /* A sNaN is only guaranteed to be representable in variables with static (or
@@ -243,6 +261,7 @@ main (int argc, char *argv[])
 
   result |= t1 ();
   result |= t2 ();
+  result |= t3 ();
   result |= F ();
 
   result |= fflush (stdout) == EOF;
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index f7e5f61..c4ff833 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -936,7 +936,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 	    /* Make sure the full string "(nil)" is printed.  */	      \
 	    if (prec < 5)						      \
 	      prec = 5;							      \
-	    is_long = 0;	/* This is no wide-char string.  */	      \
+	    /* This is a wide string iff compiling wprintf.  */		      \
+	    is_long = sizeof (CHAR_T) > 1;				      \
 	    goto LABEL (print_string);					      \
 	  }								      \
       }									      \

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |    8 ++++++++
 NEWS                      |    2 +-
 stdio-common/tstdiomisc.c |   19 +++++++++++++++++++
 stdio-common/vfprintf.c   |    3 ++-
 4 files changed, 30 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]