From bdc900ed8e4e1a05d92e1991afde8274fa89d725 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 2 Feb 2024 15:34:03 -0500 Subject: [PATCH] bt2c::Logger::_logStrNoThrow(): use `msg`, not `_mBuf.data()` By chance those were always the same, but from the _logStrNoThrow() point of view, it must use `msg`. Signed-off-by: Philippe Proulx Change-Id: Ie91ea9e6ff3b8f26c214904aaa9bd036b8dacfcb Reviewed-on: https://review.lttng.org/c/babeltrace/+/11741 --- src/cpp-common/bt2c/logging.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cpp-common/bt2c/logging.hpp b/src/cpp-common/bt2c/logging.hpp index beb64c26..159e909b 100644 --- a/src/cpp-common/bt2c/logging.hpp +++ b/src/cpp-common/bt2c/logging.hpp @@ -559,17 +559,17 @@ private: if (AppendCauseV) { if (_mSelfMsgIter) { bt_current_thread_error_append_cause_from_message_iterator( - _mSelfMsgIter->libObjPtr(), fileName, lineNo, "%s%s", initMsg, _mBuf.data()); + _mSelfMsgIter->libObjPtr(), fileName, lineNo, "%s%s", initMsg, msg); } else if (_mSelfComp) { bt_current_thread_error_append_cause_from_component( - _mSelfComp->libObjPtr(), fileName, lineNo, "%s%s", initMsg, _mBuf.data()); + _mSelfComp->libObjPtr(), fileName, lineNo, "%s%s", initMsg, msg); } else if (_mSelfCompCls) { bt_current_thread_error_append_cause_from_component_class( - _mSelfCompCls->libObjPtr(), fileName, lineNo, "%s%s", initMsg, _mBuf.data()); + _mSelfCompCls->libObjPtr(), fileName, lineNo, "%s%s", initMsg, msg); } else { BT_ASSERT(_mModuleName); - bt_current_thread_error_append_cause_from_unknown( - _mModuleName->data(), fileName, lineNo, "%s%s", initMsg, _mBuf.data()); + bt_current_thread_error_append_cause_from_unknown(_mModuleName->data(), fileName, + lineNo, "%s%s", initMsg, msg); } } } -- 2.34.1