Skip to content

Commit dce7413

Browse files
authored
Fix trailing zero when not CODE_128_C
Fix trailing zero when not CODE_128_C
1 parent ce97ee5 commit dce7413

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

barcode.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
require_once 'vendor/autoload.php';
1616

17-
define("_BC_VERSION", "1.0.7");
17+
define("_BC_VERSION", "1.0.8");
1818

1919
# default padding for cli messages
2020
define("_BC_PADDING", 30);
@@ -340,8 +340,8 @@ function vPrint($input) {
340340
$bc_type = constant('Picqer\Barcode\BarcodeGenerator::TYPE_'.$encoding);
341341

342342
// add trailling zero if odd digits on Code128C
343-
$bc_string = strlen($bc_string) % 2 == 0 && $encoding === 'CODE_128_C'?
344-
$bc_string : '0'.$bc_string;
343+
$bc_string = strlen($bc_string) % 2 != 0 && $encoding === 'CODE_128_C'?
344+
'0'.$bc_string : $bc_string;
345345

346346
// create appropriate generator
347347
$generator = null;

0 commit comments

Comments
 (0)