From 411ef7d7b664873087d8a569009e6e683f73b470 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Sep 2004 16:33:39 +0500 Subject: Small fixes to patch for #5371 libmysql/libmysql.c: Code trimmed --- libmysql/libmysql.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libmysql') 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; } -- cgit v1.2.1