BUG with wine/dlls/ntdll/string.c:_ultoa() ???!!??

Johann Messner johann.messner at zid.uni-linz.ac.at
Thu Aug 30 07:18:09 CDT 2001


Hi there,

First: thanks & compliments for your impressive project!!!

please check wine/dlls/ntdll/string.c:_ultoa() ... I think there is
a bug in it ...

hans

==> this is the path to it in the web cvs:
http://winehq.tiepmiep.dk/cvsweb/wine/dlls/ntdll/string.c?rev=1.3&content-type=text/x-cvsweb-markup


==> this is the source snippet with the patch as suggested ...

/*********************************************************************
 *                  _ultoa   (NTDLL)
 */
static char *_ultoa( unsigned int  x, char *buf, int radix )
{
    char buffer[32], *p;

    p = buffer + sizeof(buffer);
    *--p = 0;
    do
    {
        int rem = x % radix;
        *--p = (rem <= 9) ? rem + '0' : rem + 'a' - 10;
        x /= radix;
    } while (x);
    // MeJ 30-Aug-2001 ... oups there is a BUG
    // original strcpy( buf, p + 1 );
    //                       ^^^^^^ why +1 ????? *p contains the first digit!!!
    strcpy( buf, p);
    return buf;
}

-- 
-----------------------------------------------------------------------
  Johann Messner
  ZID Zentraler Informatik Dienst         Abt. Wissenschaftl. Rechnen    
  Johannes Kepler Universitaet               Altenbergerstrasse 69
  A-4040 Linz, A U S T R I A                 Tel. +43 732/2468-8203
  e-mail johann.messner at zid.uni-linz.ac.at   Fax. +43 732/2468-8688
-----------------------------------------------------------------------




More information about the wine-patches mailing list