From 08aefa6aea4a50b445af689b95b2105be460ad9b Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sat, 26 Nov 2016 11:38:00 +0000 Subject: [PATCH] Include string terminator when keeping track of b256 encoded characters bug report and patch by brunt, ticket #48 --- backend/dmatrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/dmatrix.c b/backend/dmatrix.c index da456b28..c93a1eea 100644 --- a/backend/dmatrix.c +++ b/backend/dmatrix.c @@ -250,7 +250,7 @@ static void dminsert(char binary_string[], const int posn, const char newbit) { int i, end; end = (int) strlen(binary_string); - for (i = end; i > posn; i--) { + for (i = end + 1; i > posn; i--) { binary_string[i] = binary_string[i - 1]; } binary_string[posn] = newbit;