[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-gcc
Subject:    RedHat optimized pricing algorithm bug ( for clients only ) ...
From:       dlibenzi () maticad ! it (Davide Libenzi)
Date:       1998-09-11 15:13:27
[Download RAW message or body]

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.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic