summaryrefslogtreecommitdiff
path: root/toxcore/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/network.c')
-rw-r--r--toxcore/network.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toxcore/network.c b/toxcore/network.c
index ed3dff8a..c6c4965e 100644
--- a/toxcore/network.c
+++ b/toxcore/network.c
@@ -49,7 +49,6 @@ uint64_t current_time(void)
49} 49}
50 50
51/* return a random number. 51/* return a random number.
52 * NOTE: This function should probably not be used where cryptographic randomness is absolutely necessary.
53 */ 52 */
54uint32_t random_int(void) 53uint32_t random_int(void)
55{ 54{
@@ -57,7 +56,9 @@ uint32_t random_int(void)
57 /* NOTE: this function comes from libsodium. */ 56 /* NOTE: this function comes from libsodium. */
58 return randombytes_random(); 57 return randombytes_random();
59#else 58#else
60 return random(); 59 uint32_t randnum;
60 randombytes((uint8_t *)&randnum , sizeof(randnum));
61 return randnum;
61#endif 62#endif
62} 63}
63 64