stcorp / coda

The Common Data Access toolset
http://stcorp.github.io/coda/doc/html/index.html
BSD 3-Clause "New" or "Revised" License
37 stars 17 forks source link

coda_netcdf_basic_type_new(): Convert assert & exit -> set an error and cleanup #62

Closed schwehr closed 4 years ago

schwehr commented 4 years ago

Had to also modify coda_netcdf_type_delete() to handle when type->definition is still NULL.

Fixes #61

svniemeijer commented 4 years ago

This is not the way to fix it. The assert means that the function should never be called with an nc_type that is out of range. The check therefore has to happen one level higher up.