Correct some memory leaks found by MSVC

This commit is contained in:
hooper114 2009-06-18 10:20:23 +00:00
parent 6c631bf282
commit 18b986156f
10 changed files with 60 additions and 35 deletions

View file

@ -92,7 +92,7 @@ int is_sane(char test_string[], unsigned char source[])
{ /* Verifies that a string only uses valid characters */
unsigned int i, j, latch;
for(i = 0; i < ustrlen(source); i++) {
for(i = 0; i < ustrlen(source) - 1; i++) {
latch = FALSE;
for(j = 0; j < strlen(test_string); j++) {
if (source[i] == test_string[j]) { latch = TRUE; } }
@ -231,6 +231,19 @@ int is_stackable(int symbology) {
return 0;
}
int is_extendable(int symbology) {
/* Indicates which symbols can have addon */
if(symbology == BARCODE_EANX) { return 1; }
if(symbology == BARCODE_UPCA) { return 1; }
if(symbology == BARCODE_UPCE) { return 1; }
if(symbology == BARCODE_ISBNX) { return 1; }
if(symbology == BARCODE_UPCA_CC) { return 1; }
if(symbology == BARCODE_UPCE_CC) { return 1; }
if(symbology == BARCODE_EANX_CC) { return 1; }
return 0;
}
int roundup(float input)
{
float remainder;