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

@ -249,12 +249,12 @@ print_decimal(const my_decimal *dec)
int i, end;
char buff[512], *pos;
pos= buff;
pos+= my_sprintf(buff, (buff, "Decimal: sign: %d intg: %d frac: %d { ",
dec->sign(), dec->intg, dec->frac));
pos+= sprintf(buff, "Decimal: sign: %d intg: %d frac: %d { ",
dec->sign(), dec->intg, dec->frac);
end= ROUND_UP(dec->frac)+ROUND_UP(dec->intg)-1;
for (i=0; i < end; i++)
pos+= my_sprintf(pos, (pos, "%09d, ", dec->buf[i]));
pos+= my_sprintf(pos, (pos, "%09d }\n", dec->buf[i]));
pos+= sprintf(pos, "%09d, ", dec->buf[i]);
pos+= sprintf(pos, "%09d }\n", dec->buf[i]);
fputs(buff, DBUG_FILE);
}