atrri

Refractive indices varying with wavelength
git clone git://git.meso-star.fr/atrri.git
Log | Files | Refs | README | LICENSE

commit 16e27c21f6711060abed6661e21fd404522d4985
parent df65eb1cb032efe96b3568c4391ccb012f214855
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 13 Jan 2021 12:53:10 +0100

Return an error if the file to load is empty

Diffstat:
Msrc/atrri.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/atrri.c b/src/atrri.c @@ -160,6 +160,12 @@ load_stream(struct atrri* atrri, FILE* stream, const char* stream_name) if(res != RES_OK) goto error; } + if(darray_refractive_id_size_get(&atrri->refract_ids) == 0) { + log_err(atrri, "%s: empty file.\n", stream_name); + res = RES_BAD_ARG; + goto error; + } + exit: if(txtrdr) txtrdr_ref_put(txtrdr); return res;