about summary refs log tree commit diff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-03-30 05:39:35 +0000
committerUlrich Drepper <drepper@redhat.com>2008-03-30 05:39:35 +0000
commit43f6bec195805539de8c3ef717fe3529809478df (patch)
tree0f034399765a3f6c25a63560b6acf831b58e0d2e /stdio-common/vfprintf.c
parente8a3212650421c7970bc776b4609987bd47a8cdf (diff)
downloadglibc-43f6bec195805539de8c3ef717fe3529809478df.tar.gz
glibc-43f6bec195805539de8c3ef717fe3529809478df.tar.xz
glibc-43f6bec195805539de8c3ef717fe3529809478df.zip
* stdio-common/vfprintf.c (vfprintf): Correct overflow test.
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index d10a5c6a13..ca6343c37f 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1513,7 +1513,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
       if (prec > width
 	  && prec + 32 > (int)(sizeof (work_buffer) / sizeof (work_buffer[0])))
 	{
-	  if (__builtin_expect (prec > ~((size_t) 0) - 31, 0))
+	  if (__builtin_expect (prec > ~((size_t) 0) / sizeof (CHAR_T) - 31,
+				0))
 	    {
 	      done = -1;
 	      goto all_done;