Improve seed() function

This commit is contained in:
Landon Curt Noll
2021-12-07 00:44:57 -08:00
parent f9464652fe
commit 7ffbaf922e
7 changed files with 190 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
/*
* have_environ - Determine if we have the environ user environment value
* have_environ - Determine if we have the environ user environment synbol
*
* Copyright (C) 2021 Landon Curt Noll
*
@@ -37,8 +37,8 @@
* This prog outputs:
*
* HAVE_ENVIRON
* defined ==> environ is an extern symbol
* undefined ==> environ is NOT an extern symbol
* defined ==> environ is an non-NULL extern symbol
* undefined ==> environ is NOT an extern symbol or is NULL
*/
#include <stdio.h>
@@ -47,9 +47,6 @@
#include "banned.h" /* include after system header <> includes */
extern char **environ; /* user environment */
int
main(void)
{
@@ -57,13 +54,17 @@ main(void)
printf("#undef HAVE_ENVIRON /* no */\n");
#else /* HAVE_NO_CONST */
#else /* HAVE_NO_ENVIRON */
const char * const str = "const";
extern char **environ;
printf("#define HAVE_ENVIRON /* yes */\n");
if (environ == NULL) {
printf("#define HAVE_ENVIRON /* no */\n");
} else {
printf("#define HAVE_ENVIRON /* yes */\n");
}
#endif /* HAVE_NO_CONST */
#endif /* HAVE_NO_ENVIRON */
/* exit(0); */
return 0;