diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-08-05 13:24:33 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-08-05 13:24:33 -0700 |
commit | 84729c4dfa6d16cf81aa23c249d0ffb030549e08 (patch) | |
tree | 76e71d7c457f3a377f33dd84a5bb9a7872f5f412 /fishd.cpp | |
parent | 8de8877c7c0972db668b06ca5d693f622a54c97a (diff) |
Additional warnings cleanup, effective C++ violations, dead code removal
Diffstat (limited to 'fishd.cpp')
-rw-r--r-- | fishd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -224,8 +224,9 @@ static void sprint_rand_digits( char *str, int maxlen ) Cast to unsigned so that wrapping occurs on overflow as per ANSI C. */ (void)gettimeofday( &tv, NULL ); - srand( (unsigned int)tv.tv_sec + (unsigned int)tv.tv_usec * 1000000UL ); - max = 1 + (maxlen - 1) * (rand() / (RAND_MAX + 1.0)); + unsigned long long seed = tv.tv_sec + tv.tv_usec * 1000000ULL; + srand( (unsigned int)seed ); + max = (int)(1 + (maxlen - 1) * (rand() / (RAND_MAX + 1.0))); for( i = 0; i < max; i++ ) { str[i] = '0' + 10 * (rand() / (RAND_MAX + 1.0)); |