From eef59d150e9abed5e04d6514bbb08ba3628abf94 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Thu, 11 May 2017 20:15:10 +0100 Subject: [PATCH] Prevent control characters from corrupting SVG Bug fix by Maikel Houthuijzen --- backend/svg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/svg.c b/backend/svg.c index aab31bd1..ced19a45 100644 --- a/backend/svg.c +++ b/backend/svg.c @@ -206,6 +206,13 @@ int svg_plot(struct zint_symbol *symbol) { } addon[r] = '\0'; + /* Don't include control characters in output text */ + for(i = 0; i < ustrlen(local_text); i++) { + if (local_text[i] < ' ') { + local_text[i] = ' '; + } + } + if (ustrlen(local_text) != 0) { textoffset = 9; } else {