Commit 6c5e4c9b authored by Alexander Barkov's avatar Alexander Barkov

Fixing -Werror=format-overflow errors (found by gcc-8.3.1)

parent 279b50b4
......@@ -2885,7 +2885,7 @@ sp_head::show_routine_code(THD *thd)
const char *format= "Instruction at position %u has m_ip=%u";
char tmp[sizeof(format) + 2*SP_INSTR_UINT_MAXLEN + 1];
sprintf(tmp, format, ip, i->m_ip);
my_snprintf(tmp, sizeof(tmp), format, ip, i->m_ip);
/*
Since this is for debugging purposes only, we don't bother to
introduce a special error code for it.
......
......@@ -362,7 +362,7 @@ int test_write(MARIA_HA *file,int id,int lock_type)
maria_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
sprintf((char*) record.id,"%7ld", (long) getpid());
my_snprintf((char*) record.id, sizeof(record.id), "%7ld", (long) getpid());
strnmov((char*) record.text,"Testing...", sizeof(record.text));
tries=(uint) rnd(100)+10;
......
......@@ -1699,8 +1699,8 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
null_bit[0]=null_pos[0]=0;
if (keyseg->null_bit)
{
sprintf(null_bit,"%d",keyseg->null_bit);
sprintf(null_pos,"%ld",(long) keyseg->null_pos+1);
my_snprintf(null_bit, sizeof(null_bit), "%d", keyseg->null_bit);
my_snprintf(null_pos, sizeof(null_pos), "%ld", (long) keyseg->null_pos+1);
}
printf("%-7ld%-5d%-9s%-10s%-30s\n",
(long) keyseg->start+1,keyseg->length,
......
......@@ -364,7 +364,7 @@ int test_write(MI_INFO *file,int id,int lock_type)
mi_extra(file,HA_EXTRA_WRITE_CACHE,0);
}
sprintf((char*) record.id,"%7ld",(long) getpid());
my_snprintf((char*) record.id, sizeof(record.id), "%7ld", (long) getpid());
strnmov((char*) record.text,"Testing...", sizeof(record.text));
tries=(uint) rnd(100)+10;
......
......@@ -1404,8 +1404,8 @@ static void descript(HA_CHECK *param, register MI_INFO *info, char * name)
null_bit[0]=null_pos[0]=0;
if (keyseg->null_bit)
{
sprintf(null_bit,"%d",keyseg->null_bit);
sprintf(null_pos,"%ld",(long) keyseg->null_pos+1);
my_snprintf(null_bit, sizeof(null_bit), "%d", keyseg->null_bit);
my_snprintf(null_pos, sizeof(null_pos), "%ld", (long) keyseg->null_pos+1);
}
printf("%-7ld%-5d%-9s%-10s%-30s\n",
(long) keyseg->start+1,keyseg->length,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment