X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fpolyhedra.c;h=c69f3540c4f60deb7c22c924b917d7d6441917b3;hp=72538b34a0042e35b2746ea83c7d10c8804e64a9;hb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;hpb=de460e831dc8578acfa8b72251ab9346c99c1f96 diff --git a/hacks/glx/polyhedra.c b/hacks/glx/polyhedra.c index 72538b34..c69f3540 100644 --- a/hacks/glx/polyhedra.c +++ b/hacks/glx/polyhedra.c @@ -91,7 +91,7 @@ extern const char *progname; } while(0) #define Malloc(lvalue,n,type) do {\ - if (!(lvalue = (type*) malloc((n) * sizeof(type)))) \ + if (!(lvalue = (type*) calloc((n), sizeof(type)))) \ Err("out of memory");\ } while(0) @@ -2418,7 +2418,7 @@ construct_polyhedra (polyhedron ***polyhedra_ret) int count = 0; polyhedron **result; - Malloc (result, last_uniform * 2 + 1, polyhedron*); + Malloc (result, last_uniform * 2 + 3, polyhedron*); while (index < last_uniform) { char sym[4]; @@ -2443,5 +2443,6 @@ construct_polyhedra (polyhedron ***polyhedra_ret) } *polyhedra_ret = result; + count++; /* leave room for teapot */ return count; }