PDP11, Unibus VAX: Fix Coverity identified warning

This commit is contained in:
Mark Pizzolato 2019-07-16 03:15:25 -07:00
parent 40731f0433
commit 89d51032e2

View file

@ -203,13 +203,8 @@ char msgbuf[80];
if (trollHungerLevel == 0) if (trollHungerLevel == 0)
return FALSE; return FALSE;
#if defined(_POSIX_VERSION) || defined (_XOPEN_VERSION)
r = (double)random();
rmax = (double)0x7fffffff;
#else
r = rand(); r = rand();
rmax = (double)RAND_MAX; rmax = (double)RAND_MAX;
#endif
if (msg[0] == DDCMP_ENQ) { if (msg[0] == DDCMP_ENQ) {
int eat = 0 + (int) (2000.0 * (r / (rmax + 1.0))); int eat = 0 + (int) (2000.0 * (r / (rmax + 1.0)));