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

[netCDF #CNJ-934792]: Possible bug in netCDF C-API



Hi Lynton,

> I am encountering what I think may be a bug in the following routine:
> 
> nc_inq_type(int ncid, nc_type xtype, char *name, size_t *sizep);
> 
> I am interested in determining the name of the NC_BYTE type so am
> calling this routine with xtype=1. I am not interested in the size of
> the type so have set sizep=NULL.
> 
> I define a finite size for the variable "name", and expect the routine
> to return the name of the type into this variable. However, the routine
> fails to set this variable.
> 
> This is surely an error?
> 
> (The document states that "If non-NULL, the name of the user defined
> type will be copied into name. It will be NC_MAX_NAME bytes or less.
> For atomic types, the type name from CDL will be given.")

Yes, and coincidentally it's a bug I also encountered last week, while
implementing an nccopy utility for netCDF-4 that just uses the netCDF
API to copy arbitrary netCDF files.  It's fixed in the current
snapshot available from

  ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz

in the source libsrc4/nc4type.c.

Writing nccopy has uncovered other bugs fixed in that snapshot, but
there are still remaining bugs we're still working on.  Please
continue to report bugs you find, especially if they're not fixed in
a recent snapshot release.

Thanks!

--Russ



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



Ticket Details
===================
Ticket ID: CNJ-934792
Department: Support netCDF
Priority: Normal
Status: Closed