about summary refs log tree commit diff
path: root/src/afl-common.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-06-28 14:18:44 +0200
committerGitHub <noreply@github.com>2022-06-28 14:18:44 +0200
commit40947508037b874020c8dd1251359fecaab04b9d (patch)
treee512d9b04e55c619adaefb22cd9ed1e33eac1feb /src/afl-common.c
parentba3c7bfe40f9b17a691958e3525828385127ad25 (diff)
parent92352951d7a8485bd2413009fcd052e85dc398fb (diff)
downloadafl++-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.c22
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;
 
 }