]> git.sesse.net Git - vlc/commitdiff
! It did say NON-PREDICTIBLE at the top of the file, didn't it?
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 2 Sep 2007 20:01:13 +0000 (20:01 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 2 Sep 2007 20:01:13 +0000 (20:01 +0000)
src/misc/rand.c

index 0caa83a99a5a64b51ea818e0462dfff01450edf4..5cdd8c63047d67a2688297950f4192f95abb2a1c 100644 (file)
@@ -116,9 +116,7 @@ void vlc_rand_bytes (void *buf, size_t len)
 }
 
 #else /* WIN32 */
-/* It would be better to use rand_s() instead of rand() but it's not possible 
- * while we support Win 2OOO and until it gets included in mingw */
-/* #define _CRT_RAND_S*/
+#define _CRT_RAND_S
 #include <stdlib.h>
 
 void vlc_rand_bytes (void *buf, size_t len)
@@ -126,8 +124,11 @@ void vlc_rand_bytes (void *buf, size_t len)
     while (len > 0)
     {
         unsigned int val;
-        /*rand_s (&val);*/
-        val = rand();
+#if 0
+        rand_s (&val);
+#else
+        abort();
+#endif
 
         if (len < sizeof (val))
         {