Skip to content

Commit

Permalink
sql_class: sprintf -> snprintf
Browse files Browse the repository at this point in the history
This was failing to compile with AppleClang 14.0.0.14000029.

Thanks to Arunesh Choudhary for noticing.
  • Loading branch information
grooverdan committed Mar 24, 2023
1 parent 91e5e47 commit 011261f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sql/sql_class.h
Expand Up @@ -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
Expand Down Expand Up @@ -6996,7 +6996,7 @@ class Database_qualified_name
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);
Expand Down

0 comments on commit 011261f

Please sign in to comment.