From 940cb9bd2743f3e1342f603b5ccdd5ec64b24cbb Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Fri, 16 Oct 2020 13:41:54 -0700 Subject: [PATCH] Remove redundant error formatting (#834) Follow-up to #794. rmw_get_error_string already formats the error with the file and line number. Signed-off-by: Jacob Perron --- rcl/src/rcl/publisher.c | 4 ++-- rcl/src/rcl/subscription.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rcl/src/rcl/publisher.c b/rcl/src/rcl/publisher.c index 73f9a4ddd..be18d27ec 100644 --- a/rcl/src/rcl/publisher.c +++ b/rcl/src/rcl/publisher.c @@ -201,8 +201,8 @@ rcl_publisher_init( rmw_ret_t rmw_fail_ret = rmw_destroy_publisher( rcl_node_get_rmw_handle(node), publisher->impl->rmw_handle); if (RMW_RET_OK != rmw_fail_ret) { - RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING( - "%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__); + RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str); + RCUTILS_SAFE_FWRITE_TO_STDERR("\n"); } } diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index 64432151b..108eaed6d 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -197,8 +197,8 @@ rcl_subscription_init( rmw_ret_t rmw_fail_ret = rmw_destroy_subscription( rcl_node_get_rmw_handle(node), subscription->impl->rmw_handle); if (RMW_RET_OK != rmw_fail_ret) { - RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING( - "%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__); + RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str); + RCUTILS_SAFE_FWRITE_TO_STDERR("\n"); } }