commit 7acafe738ad0f90619521e7e174daa739313c536
parent 016ec5db21e9378a2de8275067e657ddc93dfdbc
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 4 Feb 2026 17:55:37 +0100
Updates to error messages when loading a mixture
These are mainly formatting updates concerning a missing space or an
unnecessary period. However, some strings to be printed could be null.
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/sln_mixture.c b/src/sln_mixture.c
@@ -192,7 +192,7 @@ parse_molecule
ASSERT(line);
#define LOG(Type, Str, ...) \
- Type(mixture->sln, "%s:%lu "Str, \
+ Type(mixture->sln, "%s:%lu: "Str, \
txtrdr_get_name(txtrdr), (unsigned long)txtrdr_get_line_num(txtrdr), \
__VA_ARGS__)
@@ -217,7 +217,7 @@ parse_molecule
res = cstr_to_double(tk, &molecule->param.concentration);
if(res == RES_OK && molecule->param.concentration < 0) res = RES_BAD_ARG;
if(res != RES_OK) {
- LOG(ERROR, "invalid concentration `%s'\n", tk);
+ LOG(ERROR, "invalid concentration `%s'\n", tk ? tk : "(null)");
goto error;
}
@@ -225,7 +225,7 @@ parse_molecule
res = cstr_to_double(tk, &molecule->param.cutoff);
if(res == RES_OK && molecule->param.cutoff <= 0) res = RES_BAD_ARG;
if(res != RES_OK) {
- LOG(ERROR, "invalid cutoff `%s'\n", tk);
+ LOG(ERROR, "invalid cutoff `%s'\n", tk ? tk : "(null)");
goto error;
}
@@ -370,7 +370,7 @@ parse_line
/* If there is no molecule being analyzed, no isotopic data can be parsed */
} else if(!MOLECULE_IS_VALID(molecule)) {
- ERROR(mixture->sln, "%s:%lu: missing a molecule.\n",
+ ERROR(mixture->sln, "%s:%lu: missing a molecule\n",
txtrdr_get_name(txtrdr), (unsigned long)txtrdr_get_line_num(txtrdr));
res = RES_BAD_ARG;
goto error;