pkgsrc/x11/xpns/patches/patch-simget_c
dholland 5fb20973bf Fix wrong hard-wired paths in patch-ab. (was using /usr/X11R6)
While here:
  - sprinkle stdlib.h widely to avoid undefined behavior calling malloc
  - fix randomizer setup (was calling srand() and then using random())
  - avoid installing a csh script, since we were replacing the entire
    contents of the file anyhow
  - add missing libXt and libX11 bl3.mk
  - add patch comments

PKGREVISION -> 4.
2012-06-16 04:00:53 +00:00

29 lines
586 B
Text

$NetBSD: patch-simget_c,v 1.1 2012/06/16 04:00:54 dholland Exp $
- fix broken RAND_MAX
- since the code calls random() here, be sure to call srandom() to
initialize. Calling srand() too should be harmless.
--- simget.c~ 1993-07-14 11:02:09.000000000 +0000
+++ simget.c
@@ -19,8 +19,9 @@
#include <stdio.h>
-
-#define RAND_MAX ((1<<31)-1)
+#ifndef RAND_MAX
+#define RAND_MAX ((1UL<<31)-1)
+#endif
/*************************************************************************
@@ -32,6 +33,7 @@ void SimGetInit()
unsigned int e;
srand( 17);
+ srandom( 17);
}