{
if(c_ptr>=b_ptr+BUFSIZE)
{
+#ifdef MORE_PRINTF
+ printf("getting another %d bytes of random data ...\n",BUFSIZE);
+#endif
if(read(rand_fd,b_ptr,BUFSIZE*sizeof(u32))<BUFSIZE*sizeof(u32))
{
/* -> assume random file, end reached */
read(rand_fd,b_ptr,BUFSIZE*sizeof(u32));
}
c_ptr=b_ptr;
+#ifdef MORE_PRINTF
+ printf("got it!\n");
+#endif
}
return((u32)(*(c_ptr++)*(max*1.0/((long long unsigned int)URAND_MAX+1))));
if(y<=graph[x]) ok=1;
}
- return y;
+ return x;
}