1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-05 13:16:09 +03:00

strmake_buf(X,Y) helper, equivalent to strmake(X,Y,sizeof(X)-1)

with a bit of lame protection against abuse.
This commit is contained in:
Sergei Golubchik
2013-04-17 19:42:34 +02:00
parent 4656060f11
commit 07315d3603
27 changed files with 102 additions and 121 deletions

View File

@@ -367,7 +367,7 @@ Diagnostics_area::set_ok_status(THD *thd, ulonglong affected_rows_arg,
m_affected_rows= affected_rows_arg;
m_last_insert_id= last_insert_id_arg;
if (message_arg)
strmake(m_message, message_arg, sizeof(m_message) - 1);
strmake_buf(m_message, message_arg);
else
m_message[0]= '\0';
m_status= DA_OK;
@@ -435,7 +435,7 @@ Diagnostics_area::set_error_status(THD *thd, uint sql_errno_arg,
m_sql_errno= sql_errno_arg;
memcpy(m_sqlstate, sqlstate, SQLSTATE_LENGTH);
m_sqlstate[SQLSTATE_LENGTH]= '\0';
strmake(m_message, message_arg, sizeof(m_message)-1);
strmake_buf(m_message, message_arg);
m_status= DA_ERROR;
DBUG_VOID_RETURN;