* stdio-common/reg-printf.c (__register_printf_function): Calloc
authorRoland McGrath <roland@gnu.org>
Sat, 5 Apr 2003 00:34:07 +0000 (00:34 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 5 Apr 2003 00:34:07 +0000 (00:34 +0000)
instead of malloc __printf_arginfo_table and __printf_function_table.
Reported by John Reiser <jreiser@BitWagon.com>.

ChangeLog
stdio-common/reg-printf.c

index c663eb4d10c9deee5f75fd87dc1912d4b69f1c42..8615addc3135490a2c66dc3c8748fcae8d7efb53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * stdio-common/reg-printf.c (__register_printf_function): Calloc
+       instead of malloc __printf_arginfo_table and __printf_function_table.
+       Reported by John Reiser <jreiser@BitWagon.com>.
+
 2003-04-04  Steven Munroe  <sjmunroe@us.ibm.com>
 
        * sysdeps/powerpc/powerpc64/strchr.S: 64-bit optimizations.
index 672652ab208a5e4512f7c56933fac8e4da1750f8..826035ca6d93bc65ae99afd31e5da0caa1da5c8e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 1997, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996,1997,2002,2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -46,7 +46,7 @@ __register_printf_function (spec, converter, arginfo)
   if (__printf_function_table == NULL)
     {
       __printf_arginfo_table = (printf_arginfo_function **)
-       malloc ((UCHAR_MAX + 1) * sizeof (void *) * 2);
+       calloc (UCHAR_MAX + 1, sizeof (void *) * 2);
       if (__printf_arginfo_table == NULL)
        return -1;
       __printf_function_table = (printf_function **)