aboutsummaryrefslogtreecommitdiff
path: root/src/afl-fuzz-misc.c
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2019-09-02 18:49:43 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2019-09-02 18:49:43 +0200
commitb24639d0113e15933e749ea0f96abe3f25a134a0 (patch)
tree4272020625c80c0d6982d3787bebc573c0da01b8 /src/afl-fuzz-misc.c
parent2ae4ca91b48407add0e940ee13bd8b385e319a7a (diff)
downloadafl++-b24639d0113e15933e749ea0f96abe3f25a134a0.tar.gz
run code formatter
Diffstat (limited to 'src/afl-fuzz-misc.c')
-rw-r--r--src/afl-fuzz-misc.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/afl-fuzz-misc.c b/src/afl-fuzz-misc.c
index 69ff2f6b..eb0cc187 100644
--- a/src/afl-fuzz-misc.c
+++ b/src/afl-fuzz-misc.c
@@ -33,11 +33,16 @@ u8* DI(u64 val) {
cur = (cur + 1) % 12;
-#define CHK_FORMAT(_divisor, _limit_mult, _fmt, _cast) do { \
- if (val < (_divisor) * (_limit_mult)) { \
+#define CHK_FORMAT(_divisor, _limit_mult, _fmt, _cast) \
+ do { \
+ \
+ if (val < (_divisor) * (_limit_mult)) { \
+ \
sprintf(tmp[cur], _fmt, ((_cast)val) / (_divisor)); \
- return tmp[cur]; \
- } \
+ return tmp[cur]; \
+ \
+ } \
+ \
} while (0)
/* 0-9999 */
@@ -79,8 +84,7 @@ u8* DI(u64 val) {
}
-
-/* Describe float. Similar to the above, except with a single
+/* Describe float. Similar to the above, except with a single
static buffer. */
u8* DF(double val) {
@@ -88,20 +92,23 @@ u8* DF(double val) {
static u8 tmp[16];
if (val < 99.995) {
+
sprintf(tmp, "%0.02f", val);
return tmp;
+
}
if (val < 999.95) {
+
sprintf(tmp, "%0.01f", val);
return tmp;
+
}
return DI((u64)val);
}
-
/* Describe integer as memory size. */
u8* DMS(u64 val) {
@@ -152,14 +159,13 @@ u8* DMS(u64 val) {
}
-
/* Describe time delta. Returns one static buffer, 34 chars of less. */
u8* DTD(u64 cur_ms, u64 event_ms) {
static u8 tmp[64];
- u64 delta;
- s32 t_d, t_h, t_m, t_s;
+ u64 delta;
+ s32 t_d, t_h, t_m, t_s;
if (!event_ms) return "none seen yet";
@@ -174,3 +180,4 @@ u8* DTD(u64 cur_ms, u64 event_ms) {
return tmp;
}
+