stardis

Perform coupled heat transfer calculations
git clone git://git.meso-star.fr/stardis.git
Log | Files | Refs | README | LICENSE

commit 7191bb4fa68b5994540255799e7a8b9ac0e44976
parent a95170bcd9c605c9b1188ca987d5e249a2c9229c
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Thu,  9 Apr 2020 11:29:57 +0200

Fix -m option cannot use default time

Diffstat:
Msrc/stardis-parsing.c | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/stardis-parsing.c b/src/stardis-parsing.c @@ -589,16 +589,16 @@ re_switch: } args->mode |= MEDIUM_COMPUTE; ptr = strpbrk(optarg, ","); - if(!ptr || ptr == optarg) - res = RES_BAD_ARG; - else res = cstr_to_double(ptr + 1, args->probe + 3); - if(res != RES_OK) { - logger_print(args->logger, LOG_ERROR, - "Invalid argument for option -%c: %s\n", - opt, optarg); - goto error; + if (ptr) { + res = cstr_to_double(ptr + 1, args->probe + 3); + if (res != RES_OK) { + logger_print(args->logger, LOG_ERROR, + "Invalid argument for option -%c: %s\n", + opt, optarg); + goto error; + } + *ptr = '\0'; } - *ptr = '\0'; args->medium_name = optarg; break; }