MCPcopy Create free account
hub / github.com/apache/httpd / rand_choosenum

Function rand_choosenum

modules/md/md_crypt.c:96–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94#else /* ifdef MD_HAVE_ARC4RANDOM */
95
96static int rand_choosenum(int l, int h)
97{
98 int i;
99 char buf[50];
100
101 apr_snprintf(buf, sizeof(buf), "%.0f",
102 (((double)(rand()%RAND_MAX)/RAND_MAX)*(h-l)));
103 i = atoi(buf)+1;
104 if (i < l) i = l;
105 if (i > h) i = h;
106 return i;
107}
108
109static void seed_RAND(int pid)
110{

Callers 1

seed_RANDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected