From: Jérémie Galarneau Date: Fri, 25 Aug 2023 23:10:21 +0000 (-0400) Subject: Fix: erroneous specifier used with ERR_FMT macro X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=ae26b182aecec9d0cdd1fa70378369c69cfac182 Fix: erroneous specifier used with ERR_FMT macro ERR_FMT uses fmtlib's specifiers rather than the POSIX ones. Change-Id: Iadd914fe2f5556b4d2463a9a6861bcb4d40d9643 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.cpp b/src/bin/lttng-sessiond/main.cpp index 3e5d8eeea..bfd53e7e4 100644 --- a/src/bin/lttng-sessiond/main.cpp +++ b/src/bin/lttng-sessiond/main.cpp @@ -1982,7 +1982,7 @@ int main(int argc, char **argv) try { return _main(argc, argv); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by main thread: %s", e.what()); + ERR_FMT("Unhandled exception caught by main thread: {}", e.what()); abort(); } } diff --git a/src/bin/lttng/lttng.cpp b/src/bin/lttng/lttng.cpp index 093a9809c..48b02c627 100644 --- a/src/bin/lttng/lttng.cpp +++ b/src/bin/lttng/lttng.cpp @@ -490,7 +490,7 @@ int main(int argc, char **argv) try { return _main(argc, argv); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by client: %s", e.what()); + ERR_FMT("Unhandled exception caught by client: {}", e.what()); abort(); } } diff --git a/tests/regression/tools/trigger/utils/notification-client.cpp b/tests/regression/tools/trigger/utils/notification-client.cpp index 58ac01e6c..27bd100c6 100644 --- a/tests/regression/tools/trigger/utils/notification-client.cpp +++ b/tests/regression/tools/trigger/utils/notification-client.cpp @@ -287,7 +287,7 @@ int main(int argc, char **argv) try { return _main(argc, argv); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by notification client: %s", e.what()); + ERR_FMT("Unhandled exception caught by notification client: {}", e.what()); abort(); } } diff --git a/tests/unit/test_action.cpp b/tests/unit/test_action.cpp index c46b8fcea..52f6d26ca 100644 --- a/tests/unit/test_action.cpp +++ b/tests/unit/test_action.cpp @@ -559,7 +559,7 @@ int main() try { return _main(); } catch (const std::exception& e) { - ERR_FMT("Unhandled exception caught by action unit test: %s", e.what()); + ERR_FMT("Unhandled exception caught by action unit test: {}", e.what()); abort(); } }