* gcc.c-torture/execute/20020406-1.c (DUPFFnew): Use calloc.
From-SVN: r52254
This commit is contained in:
parent
01e93ba048
commit
36ea005204
|
@ -1,3 +1,7 @@
|
|||
2002-04-12 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* gcc.c-torture/execute/20020406-1.c (DUPFFnew): Use calloc.
|
||||
|
||||
2002-04-12 Richard Sandiford <rsandifo@redhat.com>
|
||||
|
||||
* g++.dg/ext/attrib5.C,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// PR c/5120
|
||||
|
||||
extern void * malloc (__SIZE_TYPE__);
|
||||
extern void * calloc (__SIZE_TYPE__, __SIZE_TYPE__);
|
||||
|
||||
typedef unsigned int FFelem;
|
||||
|
||||
|
@ -31,7 +32,7 @@ DUPFF DUPFFnew(const int maxdeg)
|
|||
{
|
||||
DUPFF ans = (DUPFF)malloc(sizeof(struct DUPFFstruct));
|
||||
ans->coeffs = 0;
|
||||
if (maxdeg >= 0) ans->coeffs = (FFelem*)malloc((maxdeg+1)*sizeof(FFelem));
|
||||
if (maxdeg >= 0) ans->coeffs = (FFelem*)calloc(maxdeg+1,sizeof(FFelem));
|
||||
ans->maxdeg = maxdeg;
|
||||
ans->deg = -1;
|
||||
return ans;
|
||||
|
|
Loading…
Reference in New Issue