1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Bug#45288: pb2 returns a lot of compilation warnings on linux

Although the C standard mandates that sprintf return the number
of bytes written, some very ancient systems (i.e. SunOS 4)
returned a pointer to the buffer instead. Since these systems
are not supported anymore and are hopefully long dead by now,
simply remove the portability wrapper that dealt with this
discrepancy. The autoconf check was causing trouble with GCC.
This commit is contained in:
Davi Arnaut
2010-07-09 09:00:17 -03:00
parent cd37b73fe5
commit 11fae04527
19 changed files with 90 additions and 164 deletions

View File

@ -112,7 +112,8 @@ bool String::set_real(double num,uint decimals, CHARSET_INFO *cs)
str_charset=cs;
if (decimals >= NOT_FIXED_DEC)
{
uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME
// Enough for a DATETIME
uint32 len= sprintf(buff, "%.15g", num);
return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
}
#ifdef HAVE_FCONVERT
@ -676,7 +677,7 @@ void String::qs_append(const char *str, uint32 len)
void String::qs_append(double d)
{
char *buff = Ptr + str_length;
str_length+= my_sprintf(buff, (buff, "%.15g", d));
str_length+= sprintf(buff, "%.15g", d);
}
void String::qs_append(double *d)