From da904f643865ea26f954b4f5d1b5489c36cfa00b Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Sat, 8 Feb 2020 09:21:01 -0700 Subject: [PATCH 1/2] raised NC_MAX_HDF4_NAME length to NC_MAX_NAME --- include/hdf4dispatch.h | 4 ---- include/netcdf.h | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/hdf4dispatch.h b/include/hdf4dispatch.h index c8dcffee7..f2dfdab13 100644 --- a/include/hdf4dispatch.h +++ b/include/hdf4dispatch.h @@ -14,10 +14,6 @@ #include "config.h" #include "ncdispatch.h" -/** This is the max size of an SD dataset name in HDF4 (from HDF4 - * documentation).*/ -#define NC_MAX_HDF4_NAME 64 - /** This is the max number of dimensions for a HDF4 SD dataset (from * HDF4 documentation). */ #define NC_MAX_HDF4_DIMS 32 diff --git a/include/netcdf.h b/include/netcdf.h index cc8370f2b..bb723af21 100644 --- a/include/netcdf.h +++ b/include/netcdf.h @@ -276,8 +276,11 @@ NOTE: The NC_MAX_DIMS, NC_MAX_ATTRS, and NC_MAX_VARS limits #define NC_MAX_VAR_DIMS 1024 /**< max per variable dimensions */ /**@}*/ -/** This is the max size of an SD dataset name in HDF4 (from HDF4 documentation).*/ -#define NC_MAX_HDF4_NAME 64 +/** The max size of an SD dataset name in HDF4 (from HDF4 + * documentation) is 64. But in in the wild we have encountered longer + * names. As long as the HDF4 name is not greater than NC_MAX_NAME, + * our code will be OK. */ +#define NC_MAX_HDF4_NAME NC_MAX_NAME /** In HDF5 files you can set the endianness of variables with nc_def_var_endian(). This define is used there. */ From cd38a4cf6c742d4b691631a78ffe240295255072 Mon Sep 17 00:00:00 2001 From: Edward Hartnett Date: Sat, 8 Feb 2020 09:38:44 -0700 Subject: [PATCH 2/2] updated release notes --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0d415e859..efe24ee1c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -12,6 +12,7 @@ This file contains a high-level description of this package's evolution. Release * [Enhancement] Restore use of szip compression when writing data (including writing in parallel if HDF5 version is 1.10.3 or greater). See [https://github.com/Unidata/netcdf-c/issues/1546]. * [Enhancement] Enable use of compact storage option for small vars in netCDF/HDF5 files. See [https://github.com/Unidata/netcdf-c/issues/1570]. * [Enhancement] Updated benchmarking program bm_file.c to better handle very large files. See [https://github.com/Unidata/netcdf-c/issues/1555]. +* [Enhancement] Increased size of maximum allowed name in HDF4 files to NC_MAX_NAME. See [https://github.com/Unidata/netcdf-c/issues/1631]. ## 4.7.3 - November 20, 2019