Skip to content

Commit d12c0f1

Browse files
committed
Correct code style
Signed-off-by: Ada-King <[email protected]>
1 parent 2fb4342 commit d12c0f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rcl_yaml_param_parser/src/parser.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,9 +1105,9 @@ 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");
1108+
if (strcasecmp(value, ".nan") == 0) {
1109+
char * tmp_value = (char *)value;
1110+
snprintf(tmp_value, strlen(tmp_value), "%s", "nan");
11111111
}
11121112
dval = strtod(value, &endptr);
11131113
if ((0 == errno) && (NULL != endptr)) {

0 commit comments

Comments
 (0)