diff options
author | Monty <monty@mariadb.org> | 2022-03-17 16:58:43 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2022-03-18 13:26:50 +0200 |
commit | 74e668eaeb4271845fd69d2945085383c431e333 (patch) | |
tree | 07f00512eb2773da7675d27a8f5b1aa94b0d9107 | |
parent | 22fd31c5883622b5c7451cee74bc5d087d81e112 (diff) | |
download | mariadb-git-74e668eaeb4271845fd69d2945085383c431e333.tar.gz |
Fixed warning for maria.maria-recovery2 about crashed tablebb-10.2-monty
The bug was a missing va_start in eprint() which caused a wrong table
name to be printed.
Patch backported from 10.3.
-rw-r--r-- | storage/maria/ma_recovery_util.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/storage/maria/ma_recovery_util.c b/storage/maria/ma_recovery_util.c index 9443ba90f6c..cb4203392dd 100644 --- a/storage/maria/ma_recovery_util.c +++ b/storage/maria/ma_recovery_util.c @@ -59,11 +59,12 @@ void tprint(FILE *trace_file __attribute__ ((unused)), va_list args; #ifndef DBUG_OFF { - char buff[1024], *end; + char buff[1024]; + size_t length; va_start(args, format); - vsnprintf(buff, sizeof(buff)-1, format, args); - if (*(end= strend(buff)) == '\n') - *end= 0; /* Don't print end \n */ + length= my_vsnprintf(buff, sizeof(buff)-1, format, args); + if (length && buff[length-1] == '\n') + buff[length-1]= 0; /* Don't print end \n */ DBUG_PRINT("info", ("%s", buff)); va_end(args); } @@ -95,6 +96,7 @@ void eprint(FILE *trace_file __attribute__ ((unused)), fputc('\n', trace_file); if (trace_file != stderr) { + va_start(args, format); my_printv_error(HA_ERR_INITIALIZATION, format, MYF(0), args); } va_end(args); |