From 011261f4e95890b63bac83d7842ff93ced6d3ec8 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 24 Mar 2023 08:52:28 +1100 Subject: [PATCH] sql_class: sprintf -> snprintf This was failing to compile with AppleClang 14.0.0.14000029. Thanks to Arunesh Choudhary for noticing. --- sql/sql_class.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 6fa8d696b53..d0c3e0244e7 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1749,7 +1749,7 @@ show_system_thread(enum_thread_type thread) RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_BACKGROUND); RETURN_NAME_AS_STRING(SYSTEM_THREAD_SEMISYNC_MASTER_BACKGROUND); default: - sprintf(buf, "", thread); + snprintf(buf, sizeof(buf), "", thread); return buf; } #undef RETURN_NAME_AS_STRING @@ -6996,7 +6996,7 @@ public: if (unlikely(!(dst->str= tmp= (char*) alloc_root(mem_root, dst->length + 1)))) return true; - sprintf(tmp, "%.*s%.*s%.*s", + snprintf(tmp, dst->length + 1, "%.*s%.*s%.*s", (int) m_db.length, (m_db.length ? m_db.str : ""), dot, ".", (int) m_name.length, m_name.str);