From 99afe3e2063edf476d5c46c261cf02e504d3a3c5 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 18 Apr 2023 15:02:37 -0400 Subject: [PATCH] Port: fix -Wdeprecated-declarations warning about sprintf on macOS clang 14 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Remove uses of sprintf to fix this warning: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] Change-Id: Idf3109f2eacafe0a7d18f4c132613f2f85afa09b Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- src/common/uuid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp index 8aa42a4e6..4c64c08ac 100644 --- a/src/common/uuid.cpp +++ b/src/common/uuid.cpp @@ -27,7 +27,7 @@ bool lttng_uuid_is_init; void lttng_uuid_to_str(const lttng_uuid& uuid, char *uuid_str) { - sprintf(uuid_str, LTTNG_UUID_FMT, LTTNG_UUID_FMT_VALUES(uuid)); + snprintf(uuid_str, LTTNG_UUID_STR_LEN, LTTNG_UUID_FMT, LTTNG_UUID_FMT_VALUES(uuid)); } std::string lttng::utils::uuid_to_str(const lttng_uuid& uuid) -- 2.34.1