diff options
author | van Hauser <vh@thc.org> | 2022-06-28 14:18:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 14:18:44 +0200 |
commit | 40947508037b874020c8dd1251359fecaab04b9d (patch) | |
tree | e512d9b04e55c619adaefb22cd9ed1e33eac1feb /src/afl-common.c | |
parent | ba3c7bfe40f9b17a691958e3525828385127ad25 (diff) | |
parent | 92352951d7a8485bd2413009fcd052e85dc398fb (diff) | |
download | afl++-40947508037b874020c8dd1251359fecaab04b9d.tar.gz |
Merge pull request #1438 from AFLplusplus/dev 4.01c
push to stable
Diffstat (limited to 'src/afl-common.c')
-rw-r--r-- | src/afl-common.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/afl-common.c b/src/afl-common.c index eca7d272..7f482e7d 100644 --- a/src/afl-common.c +++ b/src/afl-common.c @@ -25,8 +25,12 @@ #include <stdlib.h> #include <stdio.h> -#define _GNU_SOURCE -#define __USE_GNU +#ifndef _GNU_SOURCE + #define _GNU_SOURCE +#endif +#ifndef __USE_GNU + #define __USE_GNU +#endif #include <string.h> #include <strings.h> #include <math.h> @@ -715,17 +719,23 @@ char *get_afl_env(char *env) { char *val; - if ((val = getenv(env)) != NULL) { + if ((val = getenv(env))) { - if (!be_quiet) { + if (*val) { + + if (!be_quiet) { + + OKF("Enabled environment variable %s with value %s", env, val); + + } - OKF("Loaded environment variable %s with value %s", env, val); + return val; } } - return val; + return NULL; } |