[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20010109: Ncvar::rec_size typo



>From: Morten Pedersen <address@hidden>
>Subject: Ncvar::rec_size typo 
>Organization: ?
>Keywords: 200101091314.f09DECo20971 netCDF Ncvar

Hi Morten,

> A little correction for netcdf 3.5
> 
> 
> Line 686 in src/cxx/netcdf.cpp  (in NcVar::rec_siz)
> should read 
>   delete [] edge;
> instead of
>   delete edge;
> in order to get purify to shut up, and to conform to all deletes of edge
> in the NcVar class
> 
> The code looks the same in 3.4 and 3.6beta6.
> 
> A corrected version of NcVar::rec_siz
> looks like
> 
> long NcVar::rec_size(void) {
>     long size = 1;
>     long* edge = edges();
>     for( int i = num_dims()-1 ; i>0 ; i--)
>         size *= edge[i];
>     delete [] edge;  // added brackets
>     return size;
> }                       

Thanks very much for the fix, I've incorporated it into the netCDF-3.5
release, which I hope to make available in February.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu