Audit of error codes

This commit is contained in:
Robin Stuart 2017-07-27 16:01:53 +01:00
parent 58e80a9ff7
commit 608b4b9134
38 changed files with 345 additions and 345 deletions

View file

@ -174,28 +174,28 @@ int emf_plot(struct zint_symbol *symbol) {
box_t box;
#ifndef _MSC_VER
unsigned char local_text[bump_up(ustrlen(symbol->text) + 1)];
unsigned char string_buffer[2 * bump_up(ustrlen(symbol->text) + 1)];
#else
unsigned char* local_text;
unsigned char* string_buffer;
emr_rectangle_t *rectangle, *row_binding;
emr_ellipse_t* circle;
emr_polygon_t* hexagon;
local_text = (unsigned char*) _alloca(bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
string_buffer = (unsigned char*) _alloca(2 * bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
#endif
row_height = 0;
textdone = 0;
comp_offset = 0;
this_rectangle = 0;
this_circle = 0;
this_hexagon = 0;
dx = 0;
latch = 0;
#ifndef _MSC_VER
unsigned char local_text[bump_up(ustrlen(symbol->text) + 1)];
unsigned char string_buffer[2 * bump_up(ustrlen(symbol->text) + 1)];
#else
unsigned char* local_text;
unsigned char* string_buffer;
emr_rectangle_t *rectangle, *row_binding;
emr_ellipse_t* circle;
emr_polygon_t* hexagon;
local_text = (unsigned char*) _alloca(bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
string_buffer = (unsigned char*) _alloca(2 * bump_up(ustrlen(symbol->text) + 1) * sizeof (unsigned char));
#endif
row_height = 0;
textdone = 0;
comp_offset = 0;
this_rectangle = 0;
this_circle = 0;
this_hexagon = 0;
dx = 0;
latch = 0;
for(i = 0; i < 6; i++) {
regw[i] = '\0';
regx[i] = '\0';
@ -239,12 +239,12 @@ int emf_plot(struct zint_symbol *symbol) {
to_upper((unsigned char*) symbol->bgcolour);
if (strlen(symbol->fgcolour) != 6) {
strcpy(symbol->errtxt, "Malformed foreground colour target (F41)");
strcpy(symbol->errtxt, "641: Malformed foreground colour target");
return ZINT_ERROR_INVALID_OPTION;
}
if (strlen(symbol->bgcolour) != 6) {
strcpy(symbol->errtxt, "Malformed background colour target (F42)");
strcpy(symbol->errtxt, "642: Malformed background colour target");
return ZINT_ERROR_INVALID_OPTION;
}
@ -1016,7 +1016,7 @@ int emf_plot(struct zint_symbol *symbol) {
emf_file = fopen(symbol->outfile, "w");
}
if (emf_file == NULL) {
strcpy(symbol->errtxt, "Could not open output file (F40)");
strcpy(symbol->errtxt, "640: Could not open output file");
return ZINT_ERROR_FILE_ACCESS;
}