diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Tfloat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index 01a5607..9f7b4f7 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -106,11 +106,11 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, size_t mpos dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "operation not defined for datatype class"); - if (epos + esize > dt->shared->u.atomic.prec) + if (epos + esize - dt->shared->u.atomic.offset > dt->shared->u.atomic.prec) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "exponent bit field size/location is invalid"); - if (mpos + msize > dt->shared->u.atomic.prec) + if (mpos + msize - dt->shared->u.atomic.offset > dt->shared->u.atomic.prec) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mantissa bit field size/location is invalid"); - if (spos >= dt->shared->u.atomic.prec) + if (spos - dt->shared->u.atomic.offset >= dt->shared->u.atomic.prec) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign location is not valid"); /* Check for overlap */ |