1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-10-02 06:21:05 +02:00

better error handling

This commit is contained in:
q-posev 2021-03-30 16:03:34 +02:00
parent 7d24442984
commit 42df2253eb
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ trexio_exit_code trexio_hdf5_init(trexio_t* const file) {
f->$group$_group = H5Gcreate(f->file_id, $GROUP$_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
break;
}
assert (f->$group$_group > 0L);
if (f->$group$_group <= 0L) return TREXIO_INVALID_ID;
return TREXIO_SUCCESS;
}

View File

@ -441,7 +441,7 @@ trexio_exit_code trexio_text_flush_$group$(trexio_text_t* const file) {
if ($group$->to_flush == 0) return TREXIO_SUCCESS;
FILE* f = $group$->file;
assert (f != NULL);
if (f == NULL) return TREXIO_INVALID_ARG_1;
fseek(f, 0L, SEEK_SET);
/* Write the dimensioning variables */