return get_cmd_ptr(buf, NULL);
}
-static long int para_rand(long unsigned max)
-{
- return (long int) ((max + 0.0) * (random() / (RAND_MAX + 1.0)));
-}
-
static void init_rc4_keys(void)
{
int i;
for (i = 0; i < 2 * RC4_KEY_LEN; i++)
- rc4_buf[i] = para_rand(256);
+ rc4_buf[i] = para_random(256);
PARA_DEBUG_LOG("rc4 keys initialized (%u:%u)\n",
(unsigned char) rc4_buf[0],
(unsigned char) rc4_buf[RC4_KEY_LEN]);
*
* \return An integer between zero and \p max - 1, inclusively.
*/
-static inline int para_random(unsigned max)
+static inline long int para_random(unsigned max)
{
- return ((max + 0.0) * (rand() / (RAND_MAX + 1.0)));
+ return ((max + 0.0) * (random() / (RAND_MAX + 1.0)));
}
/** Round up x to a multiple of y */