diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2009-01-27 16:05:53 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2009-01-27 16:05:53 (GMT) |
commit | 4cd5a378c473faefd822beabbeccbb6e4f2f873e (patch) | |
tree | 83da835564a4e1440e57d38f90ecddb569478579 /src | |
parent | 4f48c9c5552c9c11347480de48d98eeae32b6546 (diff) | |
download | hdf5-4cd5a378c473faefd822beabbeccbb6e4f2f873e.zip hdf5-4cd5a378c473faefd822beabbeccbb6e4f2f873e.tar.gz hdf5-4cd5a378c473faefd822beabbeccbb6e4f2f873e.tar.bz2 |
[svn-r16361] Purpose: Fix potential error with H5Tset_order
Description: H5Tset_order will now properly reject H5T_ORDER_NONE for most
datatypes. Previously this could cause major problems as the file could not be
flushed.
Tested: jam, smirom (h5committest)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Torder.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5Torder.c b/src/H5Torder.c index 34dbd8e..6c0667b 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -158,6 +158,8 @@ H5Tset_order(hid_t type_id, H5T_order_t order) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") while (dt->shared->parent) dt = dt->shared->parent; /*defer to parent*/ + if (order == H5T_ORDER_NONE && !(H5T_REFERENCE == dt->shared->type || H5T_IS_FIXED_STRING(dt->shared))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal byte order") if (!H5T_IS_ATOMIC(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified datatype") |