List:Commits« Previous MessageNext Message »
From:vvaintroub Date:May 14 2008 8:23pm
Subject:bk commit into 6.0 tree (vvaintroub:1.2675)
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of vvaintroub.  When vvaintroub does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-05-14 20:23:43+02:00, vvaintroub@wva. +1 -0
  Fix crash in DBUG_PRINT with %f

  strings/my_vsnprintf.c@stripped, 2008-05-14 20:23:41+02:00, vvaintroub@wva. +5 -5
    Fix crash in DBUG_PRINT when used with %f.
    the reason for the crash was assertion in my_fcvt, because
    my_vsnprintf passed wrong parameter for precision.

diff -Nrup a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
--- a/strings/my_vsnprintf.c	2008-03-03 11:12:45 +01:00
+++ b/strings/my_vsnprintf.c	2008-05-14 20:23:41 +02:00
@@ -91,7 +91,7 @@ size_t my_vsnprintf(char *to, size_t n, 
           width= width * 10 + (uint)(*fmt - '0');
     }
     else
-      width= ~0;
+      width= SIZE_T_MAX;
     if (*fmt == 'l')
     {
       fmt++;
@@ -132,10 +132,10 @@ size_t my_vsnprintf(char *to, size_t n, 
     else if (*fmt == 'f' || *fmt == 'g')
     {
       double d= va_arg(ap, double);
-      if (width == 0)
-        width= FLT_DIG;
-      else if (width > NOT_FIXED_DEC)
-        width= NOT_FIXED_DEC; /* max.precision for my_fcvt() */
+      if (width == SIZE_T_MAX)
+        width= FLT_DIG; /* width not set, use default */
+      else if (width >= NOT_FIXED_DEC)
+        width= NOT_FIXED_DEC - 1; /* max.precision for my_fcvt() */
       width= min(width, (size_t)(end-to) - 1);
 
       if (*fmt == 'f')
Thread
bk commit into 6.0 tree (vvaintroub:1.2675)vvaintroub14 May