From: Gurusamy Sarathy Date: Wed, 16 Apr 1997 23:42:41 +0000 (-0400) Subject: Fix use of var before init in util.c X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b7c1c42da332bb339b450310a2999f9899ceb11;p=p5sagit%2Fp5-mst-13.2.git Fix use of var before init in util.c I thought I sent this a few sub-subversions ago, but it seems to be missing in 3_97e. p5p-msgid: 199704162342.TAA20773@aatma.engin.umich.edu --- diff --git a/util.c b/util.c index cdb64ad..fbed244 100644 --- a/util.c +++ b/util.c @@ -185,13 +185,13 @@ MEM_SIZE size; if ((long)size < 0 || (long)count < 0) croak("panic: calloc"); #endif + size *= count; + ptr = malloc(size?size:1); /* malloc(0) is NASTY on our system */ #if !(defined(I286) || defined(atarist)) DEBUG_m(PerlIO_printf(PerlIO_stderr(), "0x%x: (%05d) calloc %ld x %ld bytes\n",ptr,an++,(long)count,(long)size)); #else DEBUG_m(PerlIO_printf(PerlIO_stderr(), "0x%lx: (%05d) calloc %ld x %ld bytes\n",ptr,an++,(long)count,(long)size)); #endif - size *= count; - ptr = malloc(size?size:1); /* malloc(0) is NASTY on our system */ if (ptr != Nullch) { memset((void*)ptr, 0, size); return ptr;