diff --git a/backend/library.c b/backend/library.c index 68a9ab61..467e471d 100755 --- a/backend/library.c +++ b/backend/library.c @@ -88,7 +88,7 @@ void ZBarcode_Clear(struct zint_symbol *symbol) } symbol->rows = 0; symbol->width = 0; - symbol->text[0] = '\0'; + memset(symbol->text,0,128); symbol->errtxt[0] = '\0'; if (symbol->bitmap != NULL) { diff --git a/frontend/main.c b/frontend/main.c index afdd3426..95f8a58c 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -223,7 +223,12 @@ int batch_process(struct zint_symbol *symbol, char *filename) } do { - character = fgetc(file); + int intChar; + intChar = fgetc(file); + if (intChar == EOF) { + break; + } + character = (unsigned char) intChar; if(character == '\n') { if(buffer[posn - 1] == '\r') { /* CR+LF - assume Windows formatting and remove CR */