Skip to content

Commit eec7ad0

Browse files
authored
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 1bba348 commit eec7ad0

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
@@ -209,8 +209,8 @@ rcl_publisher_init(
209209
rmw_ret_t rmw_fail_ret = rmw_destroy_publisher(
210210
rcl_node_get_rmw_handle(node), publisher->impl->rmw_handle);
211211
if (RMW_RET_OK != rmw_fail_ret) {
212-
RCUTILS_SAFE_FWRITE_TO_STDERR_WITH_FORMAT_STRING(
213-
"%s, at %s:%d\n", rmw_get_error_string().str, __FILE__, __LINE__);
212+
RCUTILS_SAFE_FWRITE_TO_STDERR(rmw_get_error_string().str);
213+
RCUTILS_SAFE_FWRITE_TO_STDERR("\n");
214214
}
215215
}
216216

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)