This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Forgot to CC: support-netcdf when I sent this netCDF C++ interface bug fix out ... --Russ ------- Forwarded Message To: address@hidden (Tom LeFebvre) Subject: netCDF bug in NcAtt::is_valid() Reply-to: address@hidden Organization: UCAR Unidata Program Date: Tue, 22 Feb 1994 11:04:50 -0700 From: Russ Rew <russ@buddy> Hi Tom, I just discovered a bug and a fix for it in netcdf.cc. The problem is that the is_valid() member function returns 0 for valid global attributes. The fix is a one-liner, for which I've appended a patch. I still haven't gotten around to fixing the memory leak you reported that Purify found, but it's on my list. I intend to put out a patch soon with all the accumulated bug fixes, unless I get really ambitious and make a release instead. - --Russ =================================================================== RCS file: RCS/netcdf.cc,v retrieving revision 1.45 diff -c -r1.45 netcdf.cc *** /tmp/T0a006ap Tue Feb 22 10:58:41 1994 - --- netcdf.cc Tue Feb 22 10:58:07 1994 *************** *** 856,862 **** NcBool NcAtt::is_valid( void ) const { return the_file->is_valid() && ! the_variable->is_valid() && ncattinq(the_file->id(), the_variable->id(), the_name, 0, 0) != ncBad; } - --- 856,862 ---- NcBool NcAtt::is_valid( void ) const { return the_file->is_valid() && ! (the_variable->id() == NC_GLOBAL || the_variable->is_valid()) && ncattinq(the_file->id(), the_variable->id(), the_name, 0, 0) != ncBad; } ------- End of Forwarded Message