Skip to content

Commit

Permalink
Putative fix for #30
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme-winter committed Nov 16, 2023
1 parent bec44c8 commit 029da03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ double scale_from_units(const char *unit_string) {

int get_nxs_dataset_dims(struct ds_desc_t *desc) {
hid_t g_id, ds_id, s_id, t_id;
hsize_t dims;
int retval = 0;
int ndims = 0;
int width = 0;
g_id = desc->data_g_id;
;

ds_id = H5Dopen2(g_id, "data", H5P_DEFAULT);
if (ds_id <= 0) {
Expand Down Expand Up @@ -100,10 +100,14 @@ int get_nxs_dataset_dims(struct ds_desc_t *desc) {
ERROR_JUMP(-1, close_space, message);
}

if (H5Sget_simple_extent_dims(s_id, desc->dims, NULL) < 0) {
if (H5Sget_simple_extent_dims(s_id, dims, NULL) < 0) {
ERROR_JUMP(-1, close_space, "Error getting dataset dimensions");
}

if (dims[1] && dims[2]) {
for (j = 0; j < 3; j++) desc->dims[j] = dims[j];
}

desc->data_width = width;

close_space:
Expand Down

0 comments on commit 029da03

Please sign in to comment.