Skip to content

Commit 2fb4342

Browse files
committed
Fix yaml parser error when meets .nan
Signed-off-by: Ada-King <[email protected]>
1 parent c417f7b commit 2fb4342

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rcl_yaml_param_parser/src/parser.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,10 @@ static void * get_value(
11051105
{
11061106
errno = 0;
11071107
endptr = NULL;
1108+
if(strcasecmp(value, ".nan") == 0) {
1109+
char *tmp_value = (char *)value;
1110+
strcpy(tmp_value, "nan");
1111+
}
11081112
dval = strtod(value, &endptr);
11091113
if ((0 == errno) && (NULL != endptr)) {
11101114
if ((NULL != endptr) && (endptr != value)) {

0 commit comments

Comments
 (0)