summaryrefslogtreecommitdiff
path: root/fonts.c
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-10-24 13:32:42 +0200
committerErich Eckner <git@eckner.net>2018-10-24 13:32:42 +0200
commitc91db0902c99c783c9652458a3b460f15ae8f18e (patch)
tree5447d3721836b6ffc8ecb14999227b227d03a2da /fonts.c
parentd37c32d97c01b3573e1f1044872dfc10b75a53ae (diff)
downloadanzeige-c91db0902c99c783c9652458a3b460f15ae8f18e.tar.xz
fonts.c: render() should abort at "\0"
Diffstat (limited to 'fonts.c')
-rw-r--r--fonts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fonts.c b/fonts.c
index b8299a3..352b728 100644
--- a/fonts.c
+++ b/fonts.c
@@ -6,7 +6,7 @@ int render(unsigned char *input, int input_len, unsigned char *output, int max_o
{
memset(output, 0, max_output_len);
int output_i = 0;
- for (int input_i=0; (input_i < input_len) && (output_i*(SYMBOL_WIDTH+1) < max_output_len); input_i++) {
+ for (int input_i=0; (input_i < input_len) && (output_i*(SYMBOL_WIDTH+1) < max_output_len) && input[input_i]; input_i++) {
unsigned char c = input[input_i];
if (c >= 0x7f) {
if (c <= 0xaf) {