Skip to content
Snippets Groups Projects
Commit fddaed9e authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

handle empty spectra in rlx_get_all_spectra

parent b57329d0
Branches
No related tags found
No related merge requests found
...@@ -428,8 +428,11 @@ struct rlx_spectra** rlx_get_all_spectra(struct rlxfile* file, const struct rlx_ ...@@ -428,8 +428,11 @@ struct rlx_spectra** rlx_get_all_spectra(struct rlxfile* file, const struct rlx_
return NULL; return NULL;
struct rlx_spectra **out = malloc(sizeof(*out)*(length+1)); struct rlx_spectra **out = malloc(sizeof(*out)*(length+1));
size_t index = 0;
for(size_t i = 0; i < length; ++i) { for(size_t i = 0; i < length; ++i) {
out[i] = rlx_get_spectra(file, project, i); out[index] = rlx_get_spectra(file, project, i);
if(out[index])
++index;
} }
out[length] = NULL; out[length] = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment