From 800bce865da68a565f98296005fb120717832f53 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 25 Mar 2019 14:39:09 +0100 Subject: [PATCH] fix: sprint_bin_break doesn't skip bits when newline printing --- client/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/util.c b/client/util.c index a3f275a0b..386e56e1e 100644 --- a/client/util.c +++ b/client/util.c @@ -256,12 +256,12 @@ char *sprint_bin_break(const uint8_t *data, const size_t len, const uint8_t brea sprintf(tmp++, "."); else sprintf(tmp++, "%u", data[in_index]); + // check if a line break is needed and we have room to print it in our array if ((breaks > 0) && !((in_index + 1) % breaks) && (out_index + 1 != rowlen)) { - // increment and print line break - out_index++; sprintf(tmp++, "%s", "\n"); } + in_index++; }