Changeset 6517 for trunk/gtk/tr-prefs.c


Ignore:
Timestamp:
Aug 14, 2008, 11:11:25 AM (13 years ago)
Author:
muks
Message:

Replace random number generation code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-prefs.c

    r6491 r6517  
    4141                        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    4242                        "1234567890";
     43    GRand *rand;
    4344
    4445    cf_check_older_configs( );
     
    113114    pref_string_set_default ( PREF_KEY_RPC_ACL, TR_DEFAULT_RPC_ACL );
    114115
     116    rand = g_rand_new ();
    115117    for( i=0; i<16; ++i )
    116         pw[i] = pool[ tr_rand( strlen( pool ) ) ];
     118        pw[i] = pool[ g_rand_int_range (rand, 0, strlen(pool))];
     119    g_rand_free (rand);
     120
    117121    pw[16] = '\0';
    118122    pref_string_set_default( PREF_KEY_RPC_USERNAME, "transmission" );
Note: See TracChangeset for help on using the changeset viewer.