From: dlibenzi@maticad.it (Davide Libenzi)
Subject: RedHat optimized pricing algorithm bug ( for clients only ) ...
11 Sep 1998 17:39:36 -0700
Message-ID: <001c01bddd6c$e14e1840$1f0104c0.cygnus.gnu-win32@pcdavide>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: <egcs@cygnus.com>, "gnu-win32" <gnu-win32@cygnus.com>,
        "bug-hurd" <bug-hurd@gnu.org>,
        "cygwin32-developers" <cygwin32-developers@cygnus.com>

I've found a bug in RedHat billing algorithm :


#define MAX_TIMES    8
#define CLIENT_FOOL_CNT    2

double    client_billing (int client_id, char * card_no, double price)
{

    int ii,
        times = MAX_TIMES * (double) rand() / (double) RAND_MAX;
    double total = 0.0;

    for (ii = 0; ii < times; ii++)
    {
        charge_credit_card(card_no, price);

        if (client_angry(client_id))
            break;

        total += price;
    }

    if (ii > CLIENT_FOOL_CNT)
        push_client_in_fools(client_id);

    return (total);

}

BE ADVISED !!!


This is an example of how to aid the Linux movement.



-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
