Commit 21b14752 by Richard Henderson Committed by Richard Henderson

* gcc.c-torture/execute/20020406-1.c (DUPFFnew): Use calloc.

From-SVN: r52255
parent 0a1e123a
2002-04-12 Richard Henderson <rth@redhat.com>
* gcc.c-torture/execute/20020406-1.c (DUPFFnew): Use calloc.
2002-04-12 Geoffrey Keating <geoffk@redhat.com>
* gcc.c-torture/execute/20020412-1.c: New file, renamed from
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment