From dce7413e3ea1791b2cf0df2df95e30417dfb8755 Mon Sep 17 00:00:00 2001 From: Gustavo Arnosti Neves Date: Tue, 20 Nov 2018 14:53:18 -0200 Subject: [PATCH] Fix trailing zero when not CODE_128_C Fix trailing zero when not CODE_128_C --- barcode.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/barcode.php b/barcode.php index e179c00..358e431 100755 --- a/barcode.php +++ b/barcode.php @@ -14,7 +14,7 @@ require_once 'vendor/autoload.php'; -define("_BC_VERSION", "1.0.7"); +define("_BC_VERSION", "1.0.8"); # default padding for cli messages define("_BC_PADDING", 30); @@ -340,8 +340,8 @@ function vPrint($input) { $bc_type = constant('Picqer\Barcode\BarcodeGenerator::TYPE_'.$encoding); // add trailling zero if odd digits on Code128C -$bc_string = strlen($bc_string) % 2 == 0 && $encoding === 'CODE_128_C'? - $bc_string : '0'.$bc_string; +$bc_string = strlen($bc_string) % 2 != 0 && $encoding === 'CODE_128_C'? + '0'.$bc_string : $bc_string; // create appropriate generator $generator = null;