summaryrefslogtreecommitdiff
path: root/sql/sql_analyse.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-09 09:00:17 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-09 09:00:17 -0300
commit11fae04527098cb6c266eae41188504bd22a5b52 (patch)
tree92777d90b1eaff5ab0cb99603ecd3c4abf18d145 /sql/sql_analyse.cc
parentcd37b73fe5107098c669fcbf569e9f20de013141 (diff)
downloadmariadb-git-11fae04527098cb6c266eae41188504bd22a5b52.tar.gz
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.
Diffstat (limited to 'sql/sql_analyse.cc')
-rw-r--r--sql/sql_analyse.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index d273b3319ee..29ba956bf6c 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -408,7 +408,7 @@ void field_real::add()
if ((decs = decimals()) == NOT_FIXED_DEC)
{
- length= my_sprintf(buff, (buff, "%g", num));
+ length= sprintf(buff, "%g", num);
if (rint(num) != num)
max_notzero_dec_len = 1;
}
@@ -419,7 +419,7 @@ void field_real::add()
snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num);
length = (uint) strlen(buff);
#else
- length= my_sprintf(buff, (buff, "%-.*f", (int) decs, num));
+ length= sprintf(buff, "%-.*f", (int) decs, num);
#endif
// We never need to check further than this
@@ -1006,9 +1006,9 @@ void field_decimal::get_opt_type(String *answer,
my_decimal_set_zero(&zero);
my_bool is_unsigned= (my_decimal_cmp(&zero, &min_arg) >= 0);
- length= my_sprintf(buff, (buff, "DECIMAL(%d, %d)",
- (int) (max_length - (item->decimals ? 1 : 0)),
- item->decimals));
+ length= my_snprintf(buff, sizeof(buff), "DECIMAL(%d, %d)",
+ (int) (max_length - (item->decimals ? 1 : 0)),
+ item->decimals);
if (is_unsigned)
length= (uint) (strmov(buff+length, " UNSIGNED")- buff);
answer->append(buff, length);