From ae57d413bf5b65f5b164abf6d4a7d770b39e0246 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sun, 21 Jan 2018 11:50:49 +0000 Subject: [PATCH] UTF duplication error Removes error duplicating UTF data when using ECI 26 --- backend/eci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/eci.c b/backend/eci.c index c31eed78..b8098356 100644 --- a/backend/eci.c +++ b/backend/eci.c @@ -44,13 +44,13 @@ int utf_to_eci(const int eci, const unsigned char source[], unsigned char dest[] int out_posn; int ext; int done; - + if (eci == 26) { + int in_length = (int) *length; /* Unicode mode, do not process - just copy data across */ - for (in_posn = 0; in_posn < *length; in_posn++) { + for (in_posn = 0; in_posn < in_length; in_posn++) { dest[in_posn] = source[in_posn]; } - dest[*length] = '\0'; return 0; }