diff options
author | Erich Eckner <git@eckner.net> | 2018-10-29 11:16:52 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-10-31 21:48:36 +0100 |
commit | 3f8ec75fbd7f2be7153ef623ddd194d334955529 (patch) | |
tree | d9690e454403a6b82083afe417e8939c6f851405 /fonts.c | |
parent | 9a4619a9f40843c46ff8acc48e963515d31e3a46 (diff) | |
download | anzeige-3f8ec75fbd7f2be7153ef623ddd194d334955529.tar.xz |
fonts.c: fix return bug
Diffstat (limited to 'fonts.c')
-rw-r--r-- | fonts.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -24,5 +24,8 @@ int render(char *input, int input_len, char *output, int max_output_len, int ski output[output_i*(SYMBOL_WIDTH+1) + i] = symbols[c*SYMBOL_WIDTH + i]; output_i++; } - return output_i*(SYMBOL_WIDTH+1); + if (output_i*(SYMBOL_WIDTH+1) >= max_output_len) + return max_output_len; + else + return output_i*(SYMBOL_WIDTH+1); } |