1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

sql_class: sprintf -> snprintf

This was failing to compile with AppleClang 14.0.0.14000029.

Thanks to Arunesh Choudhary for noticing.
This commit is contained in:
Daniel Black
2023-03-24 08:52:28 +11:00
parent 91e5e47a50
commit 011261f4e9

View File

@ -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, "<UNKNOWN SYSTEM THREAD: %d>", thread);
snprintf(buf, sizeof(buf), "<UNKNOWN SYSTEM THREAD: %d>", 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);