static void print_word(BIO *bp, BN_ULONG w)
{
    int i = sizeof(w) * 8;
    char *fmt = NULL;
    unsigned char byte;

    do {
        i -= 8;
        byte = (unsigned char)(w >> i);
        if (fmt == NULL)
            fmt = byte ? "%X" : NULL;
        else
            fmt = "%02X";

        if (fmt != NULL)
            BIO_printf(bp, fmt, byte);
    } while (i);

    /* If we haven't printed anything, at least print a zero! */
    if (fmt == NULL)
        BIO_printf(bp, "0");
}