[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r4112 - in /fsf/trunk/libc: ./ localedata/ localedata/locales/ nscd/ stdio-common/



Author: eglibc
Date: Wed Nov  7 00:03:29 2007
New Revision: 4112

Log:
Import glibc-mainline for 2007-11-07

Added:
    fsf/trunk/libc/localedata/locales/bo_CN
    fsf/trunk/libc/localedata/locales/bo_IN
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/SUPPORTED
    fsf/trunk/libc/localedata/locales/dz_BT
    fsf/trunk/libc/nscd/selinux.c
    fsf/trunk/libc/stdio-common/printf_fp.c
    fsf/trunk/libc/stdio-common/vfprintf.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Nov  7 00:03:29 2007
@@ -1,3 +1,14 @@
+2007-11-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* stdio-common/vfprintf.c (vfprintf): Compute necessary buffer size
+	with size_t type.
+	* stdio-common/printf_fp.c (__print_fp): Change chars_needed type to
+	size_t.  Add casts where needed.
+
+	* nscd/selinux.c (nscd_request_avc_has_perm): When compiled with
+	old headers, don't call avc_has_perm if we don't have the
+	permission information.
+
 2007-11-05  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
 
 	* elf/rtld.c (dl_main): Use the page size to find the map start.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Wed Nov  7 00:03:29 2007
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2007-10-17
+GNU C Library NEWS -- history of user-visible changes.  2007-11-06
 Copyright (C) 1992-2006, 2007 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -7,6 +7,7 @@
 
 Version 2.8
 
+* New locales: bo_CN, bo_IN.
 
 Version 2.7
 

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Wed Nov  7 00:03:29 2007
@@ -1,3 +1,11 @@
+2007-11-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* locales/dz_BT: Fix representation of data.
+
+	* SUPPORTED (SUPPORTED-LOCALES): Add bo_CN and bo_IN.
+	* locales/bo_CN: New file.
+	* locales/bo_IN: New file.
+
 2007-10-28  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #5224]

Modified: fsf/trunk/libc/localedata/SUPPORTED
==============================================================================
--- fsf/trunk/libc/localedata/SUPPORTED (original)
+++ fsf/trunk/libc/localedata/SUPPORTED Wed Nov  7 00:03:29 2007
@@ -59,6 +59,8 @@
 bg_BG/CP1251 \
 bn_BD/UTF-8 \
 bn_IN/UTF-8 \
+bo_CN/UTF-8 \
+bo_IN/UTF-8 \
 br_FR.UTF-8/UTF-8 \
 br_FR/ISO-8859-1 \
 br_FR@euro/ISO-8859-15 \

Added: fsf/trunk/libc/localedata/locales/bo_CN
==============================================================================
--- fsf/trunk/libc/localedata/locales/bo_CN (added)
+++ fsf/trunk/libc/localedata/locales/bo_CN Wed Nov  7 00:03:29 2007
@@ -1,0 +1,170 @@
+comment_char %
+escape_char  /
+
+% Tibetan language locale for P.R. of China
+%
+% Based on dz_BT by Pema Geyleg
+
+LC_IDENTIFICATION
+title      "Tibetan language locale for P.R. of China"
+source     ""
+address    ""
+contact    ""
+email      "bug-glibc@xxxxxxx"
+tel        ""
+fax        ""
+language   "Tibetan"
+territory  "P.R. of China"
+revision   "0.1"
+date       "2007-11-06"
+%
+category  "bo_CN:2007";LC_IDENTIFICATION
+category  "bo_CN:2007";LC_CTYPE
+category  "bo_CN:2007";LC_COLLATE
+category  "bo_CN:2007";LC_NUMERIC
+category  "bo_CN:2007";LC_MONETARY
+category  "bo_CN:2007";LC_MESSAGES
+category  "bo_CN:2007";LC_PAPER
+category  "bo_CN:2007";LC_NAME
+category  "bo_CN:2007";LC_ADDRESS
+category  "bo_CN:2007";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+
+translit_start
+include "translit_combining";""
+translit_end
+END LC_CTYPE
+
+LC_COLLATE
+copy "dz_BT"
+END LC_COLLATE
+
+LC_MONETARY
+copy "zh_CN"
+END LC_MONETARY
+
+LC_NUMERIC
+copy "zh_CN"
+END LC_NUMERIC
+
+LC_TIME
+abday   "<U0F49><U0F72><U0F0B>";/
+        "<U0F5F><U0FB3><U0F0B>";/
+        "<U0F58><U0F72><U0F62><U0F0B>";/
+        "<U0F63><U0FB7><U0F42><U0F0B>";/
+        "<U0F54><U0F74><U0F62><U0F0B>";/
+        "<U0F66><U0F44><U0F66><U0F0B>";/
+        "<U0F66><U0FA4><U0F7A><U0F53><U0F0B>"
+
+day     "<U0F42><U0F5F><U0F60><U0F0B><U0F49><U0F72><U0F0B><U0F58><U0F0B>";/
+        "<U0F42><U0F5F><U0F60><U0F0B><U0F5F><U0FB3><U0F0B><U0F56><U0F0B>";/
+        "<U0F42><U0F5F><U0F60><U0F0B><U0F58><U0F72><U0F42><U0F0B><U0F51><U0F58><U0F62><U0F0B>";/
+        "<U0F42><U0F5F><U0F60><U0F0B><U0F63><U0FB7><U0F42><U0F0B><U0F55><U0F0B>";/
+        "<U0F42><U0F5F><U0F60><U0F0B><U0F54><U0F74><U0F62><U0F0B><U0F56><U0F74><U0F0B>";/
+        "<U0F42><U0F5F><U0F60><U0F0B><U0F54><U0F0B><U0F66><U0F44><U0F66><U0F0B>";/
+        "<U0F42><U0F5F><U0F60><U0F0B><U0F66><U0FA4><U0F7A><U0F53><U0F0B><U0F55><U0F0B>"
+
+abmon   "<U0F5F><U0FB3><U0F0B><U0F21>";/
+	"<U0F5F><U0FB3><U0F0B><U0F22>";/
+	"<U0F5F><U0FB3><U0F0B><U0F23>";/
+	"<U0F5F><U0FB3><U0F0B><U0F24>";/
+	"<U0F5F><U0FB3><U0F0B><U0F25>";/
+	"<U0F5F><U0FB3><U0F0B><U0F26>";/
+	"<U0F5F><U0FB3><U0F0B><U0F27>";/
+	"<U0F5F><U0FB3><U0F0B><U0F28>";/
+	"<U0F5F><U0FB3><U0F0B><U0F29>";/
+	"<U0F5F><U0FB3><U0F0B><U0F21><U0F20>";/
+	"<U0F5F><U0FB3><U0F0B><U0F21><U0F21>";/
+	"<U0F5F><U0FB3><U0F0B><U0F21><U0F22>"
+
+mon      "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F51><U0F44><U0F0B><U0F54><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F42><U0F49><U0F72><U0F66><U0F0B><U0F54><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F42><U0F66><U0F74><U0F58><U0F0B><U0F54><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F56><U0F5E><U0F72><U0F0B><U0F54><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F63><U0F94><U0F0B><U0F55><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F51><U0FB2><U0F74><U0F42><U0F0B><U0F54><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F56><U0F51><U0F74><U0F53><U0F54><U0F0B>";/
+    "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F56><U0F62><U0F92><U0FB1><U0F51><U0F0B><U0F54><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F51><U0F42><U0F74><U0F0B><U0F54><U0F0B>";/
+         "<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F56><U0F45><U0F74><U0F0B><U0F54><U0F0B>";/
+"<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F56><U0F45><U0F74><U0F0B><U0F42><U0F45><U0F72><U0F42><U0F0B><U0F54><U0F0B>";/
+"<U0F5F><U0FB3><U0F0B><U0F56><U0F0B><U0F56><U0F45><U0F74><U0F0B><U0F42><U0F49><U0F72><U0F66><U0F0B><U0F54><U0F0B>"
+
+
+
+
+% Appropriate date & time representation
+d_t_fmt      "<U0F54><U0F66><U0FB1><U0F72><U0F0B><U0F63><U0F7C><U0025><U0079><U0F5F><U0F63><U0025><U006D><U0F5A><U0F7A><U0F66>/
+<U0025><U0064><U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51><U0025><U0048><U0F40><U0F66><U0F62><U0F0B><U0F58>/
+<U0025><U004D><U0F40><U0F66><U0F62><U0F0B><U0F46><U0025><U0053>"
+
+% Appropriate date representation
+d_fmt        "<U0F54><U0F66><U0FB1><U0F72><U0F0B><U0F63><U0F7C><U0025><U0079>/
+<U0F5F><U0F63><U0025><U006D><U0F5A><U0F7A><U0F66><U0025><U0064>"
+
+% Appropriate time representation  "%H:%M:%S"
+t_fmt        "<U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51>/
+<U0025><U0048><U0F40><U0F66><U0F62><U0F0B><U0F58>/
+<U0025><U004D><U0F40><U0F66><U0F62><U0F0B><U0F46><U0025><U0053>"
+
+% AM/PM signs
+am_pm   "<U0F44><U0F66><U0F0B><U0F46>";"<U0F55><U0FB1><U0F72><U0F0B><U0F46>"
+
+% Appropriate 12-hour clock representation  "%I:%M:%S %p"
+t_fmt_ampm        "<U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51>/
+<U0025><U0049><U0F40><U0F66><U0F62><U0F0B><U0F58>/
+<U0025><U004D><U0F40><U0F66><U0F62><U0F0B><U0F46><U0025><U0053><U0020>/
+<U0025><U0070>"
+
+
+END LC_TIME
+
+LC_MESSAGES
+yesstr  "<U0F68><U0F72><U0F53>"
+nostr   "<U0F58><U0F7A><U0F53>"
+yesexpr "<U005E><U005B><U0F68><U0059><U0079><U005D><U002E><U002A>"
+noexpr  "<U005E><U005B><U0F58><U004E><U006E><U005D><U002E><U002A>"
+END LC_MESSAGES
+
+LC_TELEPHONE
+copy "zh_CN"
+END LC_TELEPHONE
+
+LC_PAPER
+copy "zh_CN"
+END LC_PAPER
+
+LC_MEASUREMENT
+copy "zh_CN"
+END LC_MEASUREMENT
+
+LC_NAME
+% FIXME
+name_fmt	"FIXME"
+name_gen	"FIXME"
+name_miss	"FIXME"
+name_mr		"FIXME"
+name_mrs	"FIXME"
+name_ms		"FIXME"
+END LC_NAME
+
+LC_ADDRESS
+% FIXME
+postal_fmt	"FIXME"
+country_name	"FIXME"
+
+country_ab2	"<U0043><U004E>"
+country_ab3	"<U0043><U0048><U004E>"
+country_num	156
+%country_car	"FIXME"
+country_isbn	"<U0037>"
+
+lang_name     "<U0F54><U0F7C><U0F51><U0F0B><U0F66><U0F90><U0F51><U0F0B>"
+lang_ab       "<U0062><U006F>"
+lang_term     "<U0062><U006F><U0064>"
+lang_lib      "<U0074><U0069><U0062>"
+END LC_ADDRESS

Added: fsf/trunk/libc/localedata/locales/bo_IN
==============================================================================
--- fsf/trunk/libc/localedata/locales/bo_IN (added)
+++ fsf/trunk/libc/localedata/locales/bo_IN Wed Nov  7 00:03:29 2007
@@ -1,0 +1,94 @@
+comment_char %
+escape_char  /
+
+% Tibetan language locale for India
+%
+% Based on dz_BT by Pema Geyleg
+
+LC_IDENTIFICATION
+title      "Tibetan language locale for India"
+source     ""
+address    ""
+contact    ""
+email      "bug-glibc@xxxxxxx"
+tel        ""
+fax        ""
+language   "Tibetan"
+territory  "India"
+revision   "0.1"
+date       "2007-11-06"
+%
+category  "bo_IN:2007";LC_IDENTIFICATION
+category  "bo_IN:2007";LC_CTYPE
+category  "bo_IN:2007";LC_COLLATE
+category  "bo_IN:2007";LC_NUMERIC
+category  "bo_IN:2007";LC_MONETARY
+category  "bo_IN:2007";LC_MESSAGES
+category  "bo_IN:2007";LC_PAPER
+category  "bo_IN:2007";LC_NAME
+category  "bo_IN:2007";LC_ADDRESS
+category  "bo_IN:2007";LC_TELEPHONE
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "bo_CN"
+END LC_CTYPE
+
+LC_COLLATE
+copy "bo_CN"
+END LC_COLLATE
+
+LC_MONETARY
+copy "hi_IN"
+END LC_MONETARY
+
+LC_NUMERIC
+% FIXME: check that grouping etc is correct
+copy "bo_CN"
+END LC_NUMERIC
+
+LC_TIME
+copy "bo_CN"
+END LC_TIME
+
+LC_MESSAGES
+copy "bo_CN"
+END LC_MESSAGES
+
+LC_TELEPHONE
+copy "hi_IN"
+END LC_TELEPHONE
+
+LC_PAPER
+copy "hi_IN"
+END LC_PAPER
+
+LC_MEASUREMENT
+copy "hi_IN"
+END LC_MEASUREMENT
+
+LC_NAME
+% FIXME
+name_fmt	"FIXME"
+name_gen	"FIXME"
+name_miss	"FIXME"
+name_mr		"FIXME"
+name_mrs	"FIXME"
+name_ms		"FIXME"
+END LC_NAME
+
+LC_ADDRESS
+% FIXME
+postal_fmt	"FIXME"
+country_name	"FIXME"
+
+country_ab2 "<U0049><U004E>"
+country_ab3 "<U0049><U004E><U0044>"
+country_num 356
+
+lang_name     "<U0F54><U0F7C><U0F51><U0F0B><U0F66><U0F90><U0F51><U0F0B>"
+lang_ab       "<U0062><U006F>"
+lang_term     "<U0062><U006F><U0064>"
+lang_lib      "<U0074><U0069><U0062>"
+END LC_ADDRESS

Modified: fsf/trunk/libc/localedata/locales/dz_BT
==============================================================================
--- fsf/trunk/libc/localedata/locales/dz_BT (original)
+++ fsf/trunk/libc/localedata/locales/dz_BT Wed Nov  7 00:03:29 2007
@@ -1209,13 +1209,13 @@
 
 LC_MONETARY
 
-int_curr_symbol         "BTN "
+int_curr_symbol         "<U0042><U0054><U004E> "
 currency_symbol    "<U0F51><U0F44><U0F74><U0F63><U0F0B><U0F40><U0FB2><U0F58><U0F0B>"
-mon_decimal_point       "."
-mon_thousands_sep       ","
+mon_decimal_point       "<U002E>"
+mon_thousands_sep       "<U002C>"
 mon_grouping            3;2;
 positive_sign           ""
-negative_sign           "-"
+negative_sign           "<U002D>"
 int_frac_digits         3
 frac_digits             3
 p_cs_precedes           1
@@ -1229,8 +1229,8 @@
 
 LC_NUMERIC
 
-decimal_point           "."
-thousands_sep           ","
+decimal_point           "<U002E>"
+thousands_sep           "<U002C>"
 grouping                3;2
 
 END LC_NUMERIC
@@ -1283,26 +1283,28 @@
 
 
 % Appropriate date & time representation
-d_t_fmt      "<U0F54><U0F66><U0FB1><U0F72><U0F0B><U0F63><U0F7C>%y<U0F5F><U0F63>%m<U0F5A><U0F7A><U0F66>/
-%d<U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51>%H<U0F40><U0F66><U0F62><U0F0B><U0F58>/
-%M<U0F40><U0F66><U0F62><U0F0B><U0F46>%S"
+d_t_fmt      "<U0F54><U0F66><U0FB1><U0F72><U0F0B><U0F63><U0F7C><U0025><U0079>/
+<U0F5F><U0F63><U0025><U006D><U0F5A><U0F7A><U0F66><U0025><U0064>/
+<U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51><U0025><U0048><U0F40>/
+<U0F66><U0F62><U0F0B><U0F58><U0025><U004D>/
+<U0F40><U0F66><U0F62><U0F0B><U0F46><U0025><U0053>"
 
 % Appropriate date representation
-d_fmt        "<U0F54><U0F66><U0FB1><U0F72><U0F0B><U0F63><U0F7C>%y<U0F5F>/
-<U0F63>%m<U0F5A><U0F7A><U0F66>%d"
+d_fmt        "<U0F54><U0F66><U0FB1><U0F72><U0F0B><U0F63><U0F7C><U0025><U0079>/
+<U0F5F><U0F63><U0025><U006D><U0F5A><U0F7A><U0F66><U0025><U0064>"
 
 % Appropriate time representation  "%H:%M:%S"
 t_fmt        "<U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51>/
-%H<U0F40><U0F66><U0F62><U0F0B><U0F58>/
-%M<U0F40><U0F66><U0F62><U0F0B><U0F46>%S"
+<U0025><U0048><U0F40><U0F66><U0F62><U0F0B><U0F58>/
+<U0025><U004D><U0F40><U0F66><U0F62><U0F0B><U0F46><U0025><U0053>"
 
 % AM/PM signs
 am_pm   "<U0F44><U0F66><U0F0B><U0F46>";"<U0F55><U0FB1><U0F72><U0F0B><U0F46>"
 
 % Appropriate 12-hour clock representation  "%I:%M:%S %p"
 t_fmt_ampm        "<U0F46><U0F74><U0F0B><U0F5A><U0F7C><U0F51>/
-%I<U0F40><U0F66><U0F62><U0F0B><U0F58>/
-%M<U0F40><U0F66><U0F62><U0F0B><U0F46>%S %p"
+<U0025><U0049><U0F40><U0F66><U0F62><U0F0B><U0F58><U0025><U004D>/
+<U0F40><U0F66><U0F62><U0F0B><U0F46><U0025><U0053><U0020><U0025><U0070>"
 
 
 END LC_TIME
@@ -1332,7 +1334,8 @@
 END LC_MEASUREMENT
 
 LC_NAME
-name_fmt    "%p%t%g%t%m%t%f"
+name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0067><U0025><U0074>/
+<U0025><U006D><U0025><U0074><U0025><U0066>"
 name_gen    ""
 name_miss   "<U0F58><U0F7C>"
 name_mr     "<U0F55><U0F7C>"

Modified: fsf/trunk/libc/nscd/selinux.c
==============================================================================
--- fsf/trunk/libc/nscd/selinux.c (original)
+++ fsf/trunk/libc/nscd/selinux.c Wed Nov  7 00:03:29 2007
@@ -368,6 +368,14 @@
       goto out;
     }
 
+#ifndef NSCD__GETSERV
+  if (perms[req] == 0)
+    {
+      dbg_log (_("compile-time support for database policy missing"));
+      goto out;
+    }
+#endif
+
   rc = avc_has_perm (ssid, tsid, SECCLASS_NSCD, perms[req], &aeref, NULL) < 0;
 
 out:

Modified: fsf/trunk/libc/stdio-common/printf_fp.c
==============================================================================
--- fsf/trunk/libc/stdio-common/printf_fp.c (original)
+++ fsf/trunk/libc/stdio-common/printf_fp.c Wed Nov  7 00:03:29 2007
@@ -808,7 +808,7 @@
   {
     int width = info->width;
     wchar_t *wstartp, *wcp;
-    int chars_needed;
+    size_t chars_needed;
     int expscale;
     int intdig_max, intdig_no = 0;
     int fracdig_min;
@@ -823,7 +823,7 @@
 	type = info->spec;
 	intdig_max = 1;
 	fracdig_min = fracdig_max = info->prec < 0 ? 6 : info->prec;
-	chars_needed = 1 + 1 + fracdig_max + 1 + 1 + 4;
+	chars_needed = 1 + 1 + (size_t) fracdig_max + 1 + 1 + 4;
 	/*	       d   .	 ddd	     e	 +-  ddd  */
 	dig_max = INT_MAX;		/* Unlimited.  */
 	significant = 1;		/* Does not matter here.  */
@@ -838,12 +838,12 @@
 	  {
 	    intdig_max = exponent + 1;
 	    /* This can be really big!	*/  /* XXX Maybe malloc if too big? */
-	    chars_needed = exponent + 1 + 1 + fracdig_max;
+	    chars_needed = (size_t) exponent + 1 + 1 + (size_t) fracdig_max;
 	  }
 	else
 	  {
 	    intdig_max = 1;
-	    chars_needed = 1 + 1 + fracdig_max;
+	    chars_needed = 1 + 1 + (size_t) fracdig_max;
 	  }
       }
     else
@@ -858,7 +858,7 @@
 	      type = isupper (info->spec) ? 'E' : 'e';
 	    fracdig_max = dig_max - 1;
 	    intdig_max = 1;
-	    chars_needed = 1 + 1 + fracdig_max + 1 + 1 + 4;
+	    chars_needed = 1 + 1 + (size_t) fracdig_max + 1 + 1 + 4;
 	  }
 	else
 	  {
@@ -870,7 +870,7 @@
 	       zeros can be as many as would be required for
 	       exponential notation with a negative two-digit
 	       exponent, which is 4.  */
-	    chars_needed = dig_max + 1 + 4;
+	    chars_needed = (size_t) dig_max + 1 + 4;
 	  }
 	fracdig_min = info->alt ? fracdig_max : 0;
 	significant = 0;		/* We count significant digits.	 */
@@ -888,16 +888,17 @@
        it is possible that we need two more characters in front of all the
        other output.  If the amount of memory we have to allocate is too
        large use `malloc' instead of `alloca'.  */
+    size_t wbuffer_to_alloc = (2 + (size_t) chars_needed) * sizeof (wchar_t);
     buffer_malloced = ! __libc_use_alloca (chars_needed * 2 * sizeof (wchar_t));
     if (__builtin_expect (buffer_malloced, 0))
       {
-	wbuffer = (wchar_t *) malloc ((2 + chars_needed) * sizeof (wchar_t));
+	wbuffer = (wchar_t *) malloc (wbuffer_to_alloc);
 	if (wbuffer == NULL)
 	  /* Signal an error to the caller.  */
 	  return -1;
       }
     else
-      wbuffer = (wchar_t *) alloca ((2 + chars_needed) * sizeof (wchar_t));
+      wbuffer = (wchar_t *) alloca (wbuffer_to_alloc);
     wcp = wstartp = wbuffer + 2;	/* Let room for rounding.  */
 
     /* Do the real work: put digits in allocated buffer.  */

Modified: fsf/trunk/libc/stdio-common/vfprintf.c
==============================================================================
--- fsf/trunk/libc/stdio-common/vfprintf.c (original)
+++ fsf/trunk/libc/stdio-common/vfprintf.c Wed Nov  7 00:03:29 2007
@@ -747,7 +747,7 @@
 	    {								      \
 	      int temp = width;						      \
 	      width = prec;						      \
-	      PAD (L_('0'));;						      \
+	      PAD (L_('0'));						      \
 	      width = temp;						      \
 	    }								      \
 									      \
@@ -1499,18 +1499,24 @@
       if (prec > width
 	  && prec + 32 > (int)(sizeof (work_buffer) / sizeof (work_buffer[0])))
 	{
-	  if (__libc_use_alloca ((prec + 32) * sizeof (CHAR_T)))
-	    workend = ((CHAR_T *) alloca ((prec + 32) * sizeof (CHAR_T)))
-		      + (prec + 32);
+	  if (__builtin_expect (prec > ~((size_t) 0) - 31, 0))
+	    {
+	      done = -1;
+	      goto all_done;
+	    }
+	  size_t needed = ((size_t) prec + 32) * sizeof (CHAR_T);
+
+	  if (__libc_use_alloca (needed))
+	    workend = (((CHAR_T *) alloca (needed)) + ((size_t) prec + 32));
 	  else
 	    {
-	      workstart = (CHAR_T *) malloc ((prec + 32) * sizeof (CHAR_T));
+	      workstart = (CHAR_T *) malloc (needed);
 	      if (workstart == NULL)
 		{
 		  done = -1;
 		  goto all_done;
 		}
-	      workend = workstart + (prec + 32);
+	      workend = workstart + ((size_t) prec + 32);
 	    }
 	}
       JUMP (*f, step2_jumps);