diff --git a/backend/medical.c b/backend/medical.c index f4d4226d..6e593f12 100644 --- a/backend/medical.c +++ b/backend/medical.c @@ -67,7 +67,7 @@ INTERNAL int pharma_one(struct zint_symbol *symbol, unsigned char source[], int char dest[64]; /* 17 * 2 + 1 */ if (length > 6) { - strcpy(symbol->errtxt, "350: Input too long"); + strcpy(symbol->errtxt, "350: Input too long (6 character maximum"); return ZINT_ERROR_TOO_LONG; } error_number = is_sane(NEON, source, length); @@ -79,7 +79,7 @@ INTERNAL int pharma_one(struct zint_symbol *symbol, unsigned char source[], int tester = atoi((char*) source); if ((tester < 3) || (tester > 131070)) { - strcpy(symbol->errtxt, "352: Data out of range"); + strcpy(symbol->errtxt, "352: Data out of range (3 to 131070)"); return ZINT_ERROR_INVALID_DATA; } @@ -122,7 +122,7 @@ static int pharma_two_calc(struct zint_symbol *symbol, unsigned char source[], c tester = atoi((char*) source); if ((tester < 4) || (tester > 64570080)) { - strcpy(symbol->errtxt, "353: Data out of range"); + strcpy(symbol->errtxt, "353: Data out of range (4 to 64570080)"); return ZINT_ERROR_INVALID_DATA; } error_number = 0; @@ -162,7 +162,7 @@ INTERNAL int pharma_two(struct zint_symbol *symbol, unsigned char source[], int strcpy(height_pattern, ""); if (length > 8) { - strcpy(symbol->errtxt, "354: Input too long"); + strcpy(symbol->errtxt, "354: Input too long (8 character maximum"); return ZINT_ERROR_TOO_LONG; } error_number = is_sane(NEON, source, length); @@ -203,13 +203,13 @@ INTERNAL int codabar(struct zint_symbol *symbol, unsigned char source[], int len strcpy(dest, ""); if (length > 60) { /* No stack smashing please */ - strcpy(symbol->errtxt, "356: Input too long"); + strcpy(symbol->errtxt, "356: Input too long (60 character maximum)"); return ZINT_ERROR_TOO_LONG; } /* BS EN 798:1995 4.2 "'Codabar' symbols shall consist of ... b) start character; * c) one or more symbol characters representing data ... d) stop character ..." */ if (length < 3) { - strcpy(symbol->errtxt, "362: Input too short"); + strcpy(symbol->errtxt, "362: Input too short (3 character minimum)"); return ZINT_ERROR_TOO_LONG; } to_upper(source); @@ -229,7 +229,11 @@ INTERNAL int codabar(struct zint_symbol *symbol, unsigned char source[], int len /* And must not use A, B, C or D otherwise (BS EN 798:1995 4.3.2) */ error_number = is_sane(CALCIUM_INNER, source + 1, length - 2); if (error_number) { - strcpy(symbol->errtxt, "363: Cannot contain \"A\", \"B\", \"C\" or \"D\""); + if (is_sane(CALCIUM, source + 1, length - 2) == 0) { + strcpy(symbol->errtxt, "363: Cannot contain \"A\", \"B\", \"C\" or \"D\""); + } else { + strcpy(symbol->errtxt, "357: Invalid characters in data"); + } return error_number; } @@ -268,7 +272,7 @@ INTERNAL int code32(struct zint_symbol *symbol, unsigned char source[], int leng /* Validate the input */ if (length > 8) { - strcpy(symbol->errtxt, "360: Input too long"); + strcpy(symbol->errtxt, "360: Input too long (8 character maximum)"); return ZINT_ERROR_TOO_LONG; } error_number = is_sane(NEON, source, length); diff --git a/backend/tests/test_library.c b/backend/tests/test_library.c index 0553364e..e600e177 100644 --- a/backend/tests/test_library.c +++ b/backend/tests/test_library.c @@ -79,7 +79,7 @@ static void test_checks(int index, int debug) { /* 19*/ { 5, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_C25STANDARD }, /* 20*/ { 12, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_EANX }, /* 21*/ { 12, "1", -1, -1, -1, -1, WARN_FAIL_ALL, 0, "", BARCODE_EANX }, - /* 22*/ { 19, "1", -1, -1, -1, -1, -1, ZINT_ERROR_TOO_LONG, "Error 362: Input too short", BARCODE_CODABAR }, + /* 22*/ { 19, "1", -1, -1, -1, -1, -1, ZINT_ERROR_TOO_LONG, "Error 362: Input too short (3 character minimum)", BARCODE_CODABAR }, /* 23*/ { 19, "A1B", -1, -1, -1, -1, -1, ZINT_WARN_INVALID_OPTION, "Warning 207: Codabar 18 not supported", BARCODE_CODABAR }, /* 24*/ { 19, "A1B", -1, -1, -1, -1, WARN_FAIL_ALL, ZINT_ERROR_INVALID_OPTION, "Error 207: Codabar 18 not supported", -1 }, /* 25*/ { 26, "1", -1, -1, -1, -1, -1, 0, "", BARCODE_UPCA }, diff --git a/win32/README b/win32/README index 96ea034f..37a76481 100644 --- a/win32/README +++ b/win32/README @@ -158,7 +158,7 @@ Administration privileges) is to create two sub-directories in "zlib\zlib.lib" and "lpng\build\Release\libpng16_static.lib" into "lib". -This example uses Qt 5.15.2 and component "MSVC 2017 32-bit" so install them and +This example uses Qt 5.15.2 and component "MSVC 2019 32-bit" so install them and add to path (your path may differ): set "PATH=C:\Qt\5.15.2\msvc2019\bin;%PATH%" diff --git a/win32/zint_cmdline_vc6/readme.txt b/win32/zint_cmdline_vc6/readme.txt index 760bf52c..b30ac566 100644 --- a/win32/zint_cmdline_vc6/readme.txt +++ b/win32/zint_cmdline_vc6/readme.txt @@ -25,4 +25,4 @@ cd $ZR\..\lpng nmake -f scripts\makefile.vcwin32 -> generates $ZR\..\lpng\libpng.lib -c) open zint_cmdline_vc6.dsp in this folder with the msvc6 gui and compile +c) open zint_cmdline_vc6.dsw in this folder with the msvc6 gui and compile