Skip to content

Commit

Permalink
Fix nc_def_var_fletcher32 operation
Browse files Browse the repository at this point in the history
re: Github Issue Unidata#2401

The nc_def_var_fletcher32 code in hdf5 is always setting fletcher32
when invoked.
Fix is to properly test value of the fletcher32 argument.
  • Loading branch information
DennisHeimbigner committed Jun 13, 2022
1 parent 5df5539 commit b1600db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libhdf5/hdf5var.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1,
}

/* Fletcher32 checksum error protection? */
if (fletcher32 && fletcher32) {
if (fletcher32 && *fletcher32) {
retval = nc_inq_var_filter_info(ncid,varid,H5Z_FILTER_FLETCHER32,NULL,NULL);
if(!retval || retval == NC_ENOFILTER) {
if((retval = nc_def_var_filter(ncid,varid,H5Z_FILTER_FLETCHER32,0,NULL))) return retval;
Expand Down

0 comments on commit b1600db

Please sign in to comment.