]> git.proxmox.com Git - proxmox-mini-journalreader.git/commitdiff
buffer should be exactly 4k big, fix off-by-one
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 14 May 2019 10:46:50 +0000 (10:46 +0000)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 14 May 2019 12:01:47 +0000 (12:01 +0000)
as the last byte never got really touched this may not do much, but
if we employ such opimizations then we should do so correctly.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/mini-journalreader.c

index 850fe799da9f21da842a87a86dcd17ef48197f9d..8420b2f2dd512054d734380d59ae3c08a2dc8505 100644 (file)
@@ -29,9 +29,9 @@
 #include <time.h>
 #include <unistd.h>
 
-#define BUFSIZE 4096
+#define BUFSIZE 4095
 
-static char buf[BUFSIZE+1];
+static char buf[BUFSIZE + 1];
 static size_t offset = 0;
 
 uint64_t get_timestamp(sd_journal *j) {