Exemplo n.º 1
0
char *AddHexSpec( char *p )
{
    char        *pref;
    unsigned    len;

    if( CurrRadix == 16 ) return( p );
    FindRadixSpec( 16, &pref, &len );
    memcpy( p, pref, len );
    p += len;
    *p = '\0';
    return( p );
}
Exemplo n.º 2
0
unsigned        DIGCLIENT MADCliRadixPrefix( unsigned radix, char *buff, unsigned buff_len )
{
    const char          *start;
    unsigned            len;

    if( radix == CurrRadix )
        return( 0 );
    FindRadixSpec( radix, &start, &len );
    if( buff_len > 0 ) {
        --buff_len;
        if( buff_len > len )
            buff_len = len;
        memcpy( buff, start, buff_len );
        buff[buff_len] = '\0';
    }
    return( len );
}