mirror of
https://github.com/MariaDB/server.git
synced 2026-04-28 03:05:33 +02:00
make my_vsnprintf() work with oversized strings
fixed replication bug - flush_master_info() needs to be called every time we read an
event from master
this is will not be pushed yet
mysys/my_vsnprintf.c:
make my_vsnprintf() work with oversized strings
corrected Swedish "skipp" in the comments
sql/log.cc:
wrong change - to be undone
sql/slave.cc:
fixed bug - flush_master_info() needs to be called every time we read an
event from master
This commit is contained in:
parent
c4ab3fc0f1
commit
3b38d3d57a
3 changed files with 9 additions and 8 deletions
|
|
@ -39,7 +39,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
|
|||
*to++= *fmt; /* Copy ordinary char */
|
||||
continue;
|
||||
}
|
||||
/* Skipp if max size is used (to be compatible with printf) */
|
||||
/* Skip if max size is used (to be compatible with printf) */
|
||||
fmt++;
|
||||
while (isdigit(*fmt) || *fmt == '.' || *fmt == '-')
|
||||
fmt++;
|
||||
|
|
@ -48,14 +48,13 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
|
|||
if (*fmt == 's') /* String parameter */
|
||||
{
|
||||
reg2 char *par = va_arg(ap, char *);
|
||||
uint plen;
|
||||
uint plen,left_len = (uint)(end-to);
|
||||
if (!par) par = (char*)"(null)";
|
||||
plen = (uint) strlen(par);
|
||||
if ((uint) (end-to) > plen) /* Replace if possible */
|
||||
{
|
||||
to=strmov(to,par);
|
||||
continue;
|
||||
}
|
||||
if (left_len <= plen)
|
||||
plen = left_len - 1;
|
||||
to=strmov(to,par);
|
||||
continue;
|
||||
}
|
||||
else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue