diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-09 09:00:17 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-07-09 09:00:17 -0300 |
commit | 11fae04527098cb6c266eae41188504bd22a5b52 (patch) | |
tree | 92777d90b1eaff5ab0cb99603ecd3c4abf18d145 /sql/field.cc | |
parent | cd37b73fe5107098c669fcbf569e9f20de013141 (diff) | |
download | mariadb-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/field.cc')
-rw-r--r-- | sql/field.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/field.cc b/sql/field.cc index 2229bc19b3c..c648b53e139 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2277,7 +2277,7 @@ int Field_decimal::store(double nr) snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr); length= strlen(buff); #else - length= my_sprintf(buff,(buff,"%.*f",dec,nr)); + length= sprintf(buff, "%.*f", dec, nr); #endif if (length > field_length) @@ -4259,7 +4259,7 @@ String *Field_float::val_str(String *val_buffer, snprintf(to,to_length-1,"%.*f",dec,nr); to=strend(to); #else - to+= my_sprintf(to,(to,"%.*f",dec,nr)); + to+= sprintf(to, "%.*f", dec, nr); #endif #endif } @@ -4617,7 +4617,7 @@ String *Field_double::val_str(String *val_buffer, snprintf(to,to_length-1,"%.*f",dec,nr); to=strend(to); #else - to+= my_sprintf(to,(to,"%.*f",dec,nr)); + to+= sprintf(to, "%.*f", dec, nr); #endif #endif } @@ -6461,7 +6461,7 @@ int Field_str::store(double nr) /* Limit precision to DBL_DIG to avoid garbage past significant digits */ set_if_smaller(digits, DBL_DIG); - length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr)); + length= (uint) sprintf(buff, "%-.*g", digits, nr); #ifdef __WIN__ /* @@ -10419,7 +10419,7 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code, { /* DBL_DIG is enough to print '-[digits].E+###' */ char str_nr[DBL_DIG + 8]; - uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr)); + uint str_len= sprintf(str_nr, "%g", nr); make_truncated_value_warning(thd, level, str_nr, str_len, ts_type, field_name); } |