summaryrefslogtreecommitdiff
path: root/libmysql/libmysql.c
diff options
context:
space:
mode:
authorhf@deer.(none) <>2004-09-07 16:33:39 +0500
committerhf@deer.(none) <>2004-09-07 16:33:39 +0500
commitf8aff9934daf03599aae3b5d5d1d4f07df0de79b (patch)
tree795c42b609771b6037c9623c412ef38fffd7eac8 /libmysql/libmysql.c
parente4ef0eadf2b259529778fe7902470472f381814a (diff)
downloadmariadb-git-f8aff9934daf03599aae3b5d5d1d4f07df0de79b.tar.gz
Small fixes to patch for #5371
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r--libmysql/libmysql.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index b4871f6bb9d..5b3db5a1a47 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -3487,10 +3487,11 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
char *end;
/* TODO: move this to a header shared between client and server. */
#define NOT_FIXED_DEC 31
- if (field->decimals >= 31)
+ if (field->decimals >= NOT_FIXED_DEC)
#undef NOT_FIXED_DEC
{
- sprintf(buff, "%-*.*g", (int) min(330, param->buffer_length), width, value);
+ sprintf(buff, "%-*.*g", (int) min(sizeof(buff)-1, param->buffer_length),
+ width, value);
end= strcend(buff, ' ');
*end= 0;
}