diff --git a/backend/telepen.c b/backend/telepen.c index 4a6740d7..744c102f 100644 --- a/backend/telepen.c +++ b/backend/telepen.c @@ -26,7 +26,7 @@ #include #include "common.h" -static char *TeleTable[128] = { "1111111111111111", "1131313111", "33313111", "1111313131", +static char *TeleTable[] = { "1111111111111111", "1131313111", "33313111", "1111313131", "3111313111", "11333131", "13133131", "111111313111", "31333111", "1131113131", "33113131", "1111333111", "3111113131", "1113133111", "1311133111", "111111113131", "3131113111", "11313331", "333331", "111131113111", "31113331", "1133113111", "1313113111", "1111113331", @@ -89,6 +89,7 @@ int telepen(struct zint_symbol *symbol, unsigned char source[]) } check_digit = 127 - (count % 127); + if(check_digit == 127) { check_digit = 0; } concat(dest, TeleTable[check_digit]); /* Stop character */ @@ -162,6 +163,7 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[]) } check_digit = 127 - (count % 127); + if(check_digit == 127) { check_digit = 0; } concat((char*)dest, TeleTable[check_digit]); /* Stop character */