From 6ac104282c273f34ce1dab16c7c5a42e79e4013b Mon Sep 17 00:00:00 2001
From: Julian Rother <julianr@fsmpi.rwth-aachen.de>
Date: Thu, 30 Nov 2017 10:24:59 +0100
Subject: [PATCH] Fixed control character enconding in jencode

---
 util/jescape.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/jescape.c b/util/jescape.c
index a2e8dec..467df72 100644
--- a/util/jescape.c
+++ b/util/jescape.c
@@ -29,8 +29,8 @@ char *jescape(char *s)
 			case '\t':
 				fputs("\\t", stream); break;
 			default:
-				if (*s <= 0x1f)
-					fprintf(stream, "\\u%04x", *s);
+				if (*s <= 0x1f && *s >= 0)
+					fprintf(stream, "\\u%04hhx", *s);
 				else
 					fputc(*s, stream);
 		}
-- 
GitLab