Skip to content

Commit 940cb9b

Browse files
committed
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 <[email protected]>
1 parent fc1a24c commit 940cb9b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rcl/src/rcl/publisher.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ rcl_publisher_init(
201201
rmw_ret_t rmw_fail_ret = rmw_destroy_publisher(
202202
rcl_node_get_rmw_handle(node), publisher->impl->rmw_handle);
203203
if (RMW_RET_OK != rmw_fail_ret) {
204-
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
205-
"%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__);
204+
RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str);
205+
RCUTILS_SAFE_FWRITE_TO_STDERR("\n");
206206
}
207207
}
208208

rcl/src/rcl/subscription.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ rcl_subscription_init(
197197
rmw_ret_t rmw_fail_ret = rmw_destroy_subscription(
198198
rcl_node_get_rmw_handle(node), subscription->impl->rmw_handle);
199199
if (RMW_RET_OK != rmw_fail_ret) {
200-
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
201-
"%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__);
200+
RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str);
201+
RCUTILS_SAFE_FWRITE_TO_STDERR("\n");
202202
}
203203
}
204204

0 commit comments

Comments
 (0)