about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2024-05-31 18:32:31 +0200
committervanhauser-thc <vh@thc.org>2024-05-31 18:32:31 +0200
commit9419e39fdfcf225cee287683ef9d1549e954c4e9 (patch)
treef1f3cb7c111b8ce956b2c3e70903f128c168d05f /src
parenta3125c38f496979be314c93f10adfad9dd4d363e (diff)
downloadafl++-9419e39fdfcf225cee287683ef9d1549e954c4e9.tar.gz
nits
Diffstat (limited to 'src')
-rw-r--r--src/afl-common.c6
-rw-r--r--src/afl-forkserver.c3
-rw-r--r--src/afl-fuzz-run.c1
3 files changed, 6 insertions, 4 deletions
diff --git a/src/afl-common.c b/src/afl-common.c
index 9a27824d..8af49e19 100644
--- a/src/afl-common.c
+++ b/src/afl-common.c
@@ -999,7 +999,7 @@ inline u64 get_cur_time(void) {
 
   struct timespec ts;
   int             rc = clock_gettime(CLOCK_MONOTONIC_COARSE, &ts);
-  if (rc == -1) {
+  if (unlikely(rc == -1)) {
 
     PFATAL("Failed to obtain timestamp (errno = %i: %s)\n", errno,
            strerror(errno));
@@ -1012,11 +1012,11 @@ inline u64 get_cur_time(void) {
 
 /* Get unix time in microseconds */
 
-u64 get_cur_time_us(void) {
+inline u64 get_cur_time_us(void) {
 
   struct timespec ts;
   int             rc = clock_gettime(CLOCK_MONOTONIC_COARSE, &ts);
-  if (rc == -1) {
+  if (unlikely(rc == -1)) {
 
     PFATAL("Failed to obtain timestamp (errno = %i: %s)\n", errno,
            strerror(errno));
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index beb6bdeb..a082982c 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -578,7 +578,8 @@ void afl_fsrv_start(afl_forkserver_t *fsrv, char **argv,
     void *nyx_config = fsrv->nyx_handlers->nyx_config_load(fsrv->target_path);
 
     fsrv->nyx_handlers->nyx_config_set_workdir_path(nyx_config, workdir_path);
-    fsrv->nyx_handlers->nyx_config_set_input_buffer_size(nyx_config, fsrv->max_length);
+    fsrv->nyx_handlers->nyx_config_set_input_buffer_size(nyx_config,
+                                                         fsrv->max_length);
     fsrv->nyx_handlers->nyx_config_set_input_buffer_write_protection(nyx_config,
                                                                      true);
 
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index b62db1ea..4e2cceff 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -1195,3 +1195,4 @@ common_fuzz_stuff(afl_state_t *afl, u8 *out_buf, u32 len) {
   return 0;
 
 }
+