Skip to content

Commit 74e668e

Browse files
committed
Fixed warning for maria.maria-recovery2 about crashed table
The bug was a missing va_start in eprint() which caused a wrong table name to be printed. Patch backported from 10.3.
1 parent 22fd31c commit 74e668e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

storage/maria/ma_recovery_util.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ void tprint(FILE *trace_file __attribute__ ((unused)),
5959
va_list args;
6060
#ifndef DBUG_OFF
6161
{
62-
char buff[1024], *end;
62+
char buff[1024];
63+
size_t length;
6364
va_start(args, format);
64-
vsnprintf(buff, sizeof(buff)-1, format, args);
65-
if (*(end= strend(buff)) == '\n')
66-
*end= 0; /* Don't print end \n */
65+
length= my_vsnprintf(buff, sizeof(buff)-1, format, args);
66+
if (length && buff[length-1] == '\n')
67+
buff[length-1]= 0; /* Don't print end \n */
6768
DBUG_PRINT("info", ("%s", buff));
6869
va_end(args);
6970
}
@@ -95,6 +96,7 @@ void eprint(FILE *trace_file __attribute__ ((unused)),
9596
fputc('\n', trace_file);
9697
if (trace_file != stderr)
9798
{
99+
va_start(args, format);
98100
my_printv_error(HA_ERR_INITIALIZATION, format, MYF(0), args);
99101
}
100102
va_end(args);

0 commit comments

Comments
 (0)