Skip to content

Commit dee753a

Browse files
authored
avoid unnecessary copy for rcutils_char_array_vsprintf. (ros2#412) (ros2#413)
Signed-off-by: Tomoya Fujita <[email protected]> (cherry picked from commit 1db1f16)
1 parent c304b9e commit dee753a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/logging.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -950,14 +950,11 @@ void rcutils_logging_console_output_handler(
950950
}
951951

952952
if (RCUTILS_RET_OK == status) {
953-
va_list args_clone;
954-
va_copy(args_clone, *args);
955-
status = rcutils_char_array_vsprintf(&msg_array, format, args_clone);
953+
status = rcutils_char_array_vsprintf(&msg_array, format, *args);
956954
if (RCUTILS_RET_OK != status) {
957955
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
958956
"Error: rcutils_char_array_vsprintf failed with: %d\n", status);
959957
}
960-
va_end(args_clone);
961958
}
962959

963960
if (RCUTILS_RET_OK == status) {

0 commit comments

Comments
 (0)