about summary refs log tree commit diff
path: root/src/afl-common.c
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-04-16 12:42:32 +0200
committervanhauser-thc <vh@thc.org>2023-04-16 12:42:32 +0200
commit56f7e3aa088e715b054f10c01b6b5a7e5acf8931 (patch)
treeb2e3c154f14bfc9d7d284a92afdd508d119f1eea /src/afl-common.c
parent87b9dc4ba0d14d7a144578faf37f899724b826a3 (diff)
downloadafl++-56f7e3aa088e715b054f10c01b6b5a7e5acf8931.tar.gz
hidden -Y option for nyx, code format
Diffstat (limited to 'src/afl-common.c')
-rw-r--r--src/afl-common.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/afl-common.c b/src/afl-common.c
index 5692e277..a5c48e80 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -1365,36 +1365,46 @@ s32 create_file(u8 *fn) {
  * etc.). This helper function basically creates both a path to a tmp workdir
  * and the workdir itself. If the environment variable TMPDIR is set, we use
  * that as the base directory, otherwise we use /tmp. */
-char* create_nyx_tmp_workdir(void) {
+char *create_nyx_tmp_workdir(void) {
 
   char *tmpdir = getenv("TMPDIR");
 
   if (!tmpdir) { tmpdir = "/tmp"; }
 
-  char* nyx_out_dir_path = alloc_printf("%s/.nyx_tmp_%d/", tmpdir, (u32)getpid());
+  char *nyx_out_dir_path =
+      alloc_printf("%s/.nyx_tmp_%d/", tmpdir, (u32)getpid());
 
-  if (mkdir(nyx_out_dir_path, 0700)) { 
-    PFATAL("Unable to create nyx workdir"); 
-  }
+  if (mkdir(nyx_out_dir_path, 0700)) { PFATAL("Unable to create nyx workdir"); }
 
   return nyx_out_dir_path;
+
 }
 
 /* Vice versa, we remove the tmp workdir for nyx with this helper function. */
-void remove_nyx_tmp_workdir(afl_forkserver_t *fsrv, char* nyx_out_dir_path) {
-  char* workdir_path = alloc_printf("%s/workdir", nyx_out_dir_path);
+void remove_nyx_tmp_workdir(afl_forkserver_t *fsrv, char *nyx_out_dir_path) {
+
+  char *workdir_path = alloc_printf("%s/workdir", nyx_out_dir_path);
 
   if (access(workdir_path, R_OK) == 0) {
-    if(fsrv->nyx_handlers->nyx_remove_work_dir(workdir_path) != true) {
+
+    if (fsrv->nyx_handlers->nyx_remove_work_dir(workdir_path) != true) {
+
       WARNF("Unable to remove nyx workdir (%s)", workdir_path);
+
     }
+
   }
 
   if (rmdir(nyx_out_dir_path)) {
+
     WARNF("Unable to remove nyx workdir (%s)", nyx_out_dir_path);
+
   }
 
   ck_free(workdir_path);
   ck_free(nyx_out_dir_path);
+
 }
+
 #endif
+