summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index 337af9f..618816b 100644
--- a/src/log.c
+++ b/src/log.c
@@ -263,9 +263,9 @@ void log_print_hex_dump(log_prio_t prio, const u_int8_t* buf, u_int32_t len)
char* ptr = &msg[offset];
for(i=0; i < len; i++) {
- if(((i+1)*3) >= (MSG_LENGTH_MAX - offset))
+ if(((i+1)*3) >= (MSG_LENGTH_MAX - offset - 1))
break;
- snprintf(ptr, 3, "%02X ", buf[i]);
+ snprintf(ptr, 4, "%02X ", buf[i]);
ptr+=3;
}
}