*** xantfarm.c.orig Wed Oct 23 12:42:38 1991 --- xantfarm.c Tue Jan 6 17:16:57 1998 *************** *** 108,119 **** /* Externals. */ ! extern char* getenv(); extern char* malloc(); extern long random(); extern char* realloc(); extern long time(); /* Forward routines. */ --- 108,120 ---- /* Externals. */ ! #ifndef __OpenBSD__ extern char* getenv(); extern char* malloc(); extern long random(); extern char* realloc(); extern long time(); + #endif /* Forward routines. */ *************** *** 395,401 **** --- 396,406 ---- } /* Initialize the random number generator. */ + #ifndef __OpenBSD__ srandom( (int) ( time( (long*) 0 ) ^ getpid() ) ); + #else + srandom( (int) ( time( (time_t*) 0 ) ^ getpid() ) ); + #endif /* Create the ant world. */ ant_init(); *************** *** 617,634 **** char buf[500]; cp = getenv( "HOME" ); ! if ( cp != (char*) 0 ) (void) strcpy( buf, cp ); else { struct passwd* pw; cp = getenv( "USER" ); ! if ( cp != (char*) 0 ) pw = getpwnam( cp ); else pw = getpwuid( getuid() ); ! if ( pw != (struct passwd*) 0 ) (void) strcpy( buf, pw->pw_dir ); else (void) strcpy( buf, "." ); /* best we can do */ --- 622,639 ---- char buf[500]; cp = getenv( "HOME" ); ! if ( cp != NULL ) (void) strcpy( buf, cp ); else { struct passwd* pw; cp = getenv( "USER" ); ! if ( cp != NULL ) pw = getpwnam( cp ); else pw = getpwuid( getuid() ); ! if ( pw != NULL ) (void) strcpy( buf, pw->pw_dir ); else (void) strcpy( buf, "." ); /* best we can do */ *************** *** 639,645 **** /* Merge in XENVIRONMENT, if any. */ xenv = getenv( "XENVIRONMENT" ); ! if ( xenv != (char*) 0 ) { XrmDatabase tdb; --- 644,650 ---- /* Merge in XENVIRONMENT, if any. */ xenv = getenv( "XENVIRONMENT" ); ! if ( xenv != NULL ) { XrmDatabase tdb; *************** *** 1530,1536 **** char* cf; { FILE* cfP; ! char* buf[500]; int w, h, x, y, c; cfP = fopen( cf, "r" ); --- 1535,1541 ---- char* cf; { FILE* cfP; ! char buf[500]; int w, h, x, y, c; cfP = fopen( cf, "r" );