diff --git a/test/test_rest_vol.c b/test/test_rest_vol.c index a27712b0..818974a9 100644 --- a/test/test_rest_vol.c +++ b/test/test_rest_vol.c @@ -17726,7 +17726,7 @@ generate_random_datatype(H5T_class_t parent_class) #if 0 if (0 == (rand() % 2)) { #endif - if ((datatype = H5Tcreate(H5T_STRING, (size_t)(rand() % STRING_TYPE_MAX_SIZE))) < 0) { + if ((datatype = H5Tcreate(H5T_STRING, (size_t)(rand() % STRING_TYPE_MAX_SIZE) + 1)) < 0) { H5_FAILED(); printf(" couldn't create fixed-length string datatype\n"); goto error;