commit f5e69aabf7a56e38e5f7a19fd89efc24ff10d845
parent e3bc6e2ef2f366f044aa0882f3c4ce78a9b1a043
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 13 Jan 2021 13:54:38 +0100
Fix and adjuste error messages printed during line parsing
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/atrri.c b/src/atrri.c
@@ -67,9 +67,9 @@ parse_line(struct atrri* atrri, struct txtrdr* txtrdr)
res = cstr_to_double(tk, &refract_id.wavelength);
if(res == RES_OK && refract_id.wavelength < 0) res = RES_BAD_ARG;
if(res != RES_OK) {
- log_err(atrri, "%s:%lu: invalid wavelength `%g' -- %s.\n",
+ log_err(atrri, "%s:%lu: invalid wavelength `%s' -- %s.\n",
txtrdr_get_name(txtrdr), (unsigned long)txtrdr_get_line_num(txtrdr),
- refract_id.wavelength, res_to_cstr(res));
+ tk, res_to_cstr(res));
goto error;
}
@@ -80,7 +80,8 @@ parse_line(struct atrri* atrri, struct txtrdr* txtrdr)
darray_refractive_id_cdata_get(&atrri->refract_ids) + nrefract_ids - 1;
if(prev_refract_id->wavelength >= refract_id.wavelength) {
log_err(atrri,
- "%s:%lu: refractive indices must be sorted in ascending order.\n,",
+ "%s:%lu: refractive indices must be sorted in ascending order "
+ "acording to their corresponding wavelength.\n",
txtrdr_get_name(txtrdr), (unsigned long)txtrdr_get_line_num(txtrdr));
res = RES_BAD_ARG;
goto error;
@@ -100,9 +101,9 @@ parse_line(struct atrri* atrri, struct txtrdr* txtrdr)
if(res == RES_OK && refract_id.n < 0) res = RES_BAD_ARG;
if(res != RES_OK) {
log_err(atrri,
- "%s:%lu: invalid real part of the refractive index `%g' -- %s.\n",
+ "%s:%lu: invalid real part of the refractive index `%s' -- %s.\n",
txtrdr_get_name(txtrdr), (unsigned long)txtrdr_get_line_num(txtrdr),
- refract_id.n, res_to_cstr(res));
+ tk, res_to_cstr(res));
goto error;
}
@@ -119,9 +120,9 @@ parse_line(struct atrri* atrri, struct txtrdr* txtrdr)
if(res == RES_OK && refract_id.kappa < 0) res = RES_BAD_ARG;
if(res != RES_OK) {
log_err(atrri,
- "%s:%lu: invalid imaginary part of the refractive index `%g' -- %s.\n",
+ "%s:%lu: invalid imaginary part of the refractive index `%s' -- %s.\n",
txtrdr_get_name(txtrdr), (unsigned long)txtrdr_get_line_num(txtrdr),
- refract_id.kappa, res_to_cstr(res));
+ tk, res_to_cstr(res));
goto error;
}