Add identifiers to error messages

To ease the debug process
This commit is contained in:
Robin Stuart
2016-10-28 22:40:40 +01:00
parent 5405035df1
commit 4561a66067
35 changed files with 296 additions and 298 deletions

View File

@ -102,7 +102,7 @@ int svg_plot(struct zint_symbol *symbol) {
fsvg = fopen(symbol->outfile, "w");
}
if (fsvg == NULL) {
strcpy(symbol->errtxt, "Could not open output file");
strcpy(symbol->errtxt, "Could not open output file (F60)");
return ZINT_ERROR_FILE_ACCESS;
}
@ -111,24 +111,24 @@ int svg_plot(struct zint_symbol *symbol) {
to_upper((unsigned char*) symbol->bgcolour);
if (strlen(symbol->fgcolour) != 6) {
strcpy(symbol->errtxt, "Malformed foreground colour target");
strcpy(symbol->errtxt, "Malformed foreground colour target (F61)");
fclose(fsvg);
return ZINT_ERROR_INVALID_OPTION;
}
if (strlen(symbol->bgcolour) != 6) {
strcpy(symbol->errtxt, "Malformed background colour target");
strcpy(symbol->errtxt, "Malformed background colour target (F62)");
fclose(fsvg);
return ZINT_ERROR_INVALID_OPTION;
}
error_number = is_sane(SSET, (unsigned char*) symbol->fgcolour, strlen(symbol->fgcolour));
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Malformed foreground colour target");
strcpy(symbol->errtxt, "Malformed foreground colour target (F63)");
fclose(fsvg);
return ZINT_ERROR_INVALID_OPTION;
}
error_number = is_sane(SSET, (unsigned char*) symbol->bgcolour, strlen(symbol->bgcolour));
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Malformed background colour target");
strcpy(symbol->errtxt, "Malformed background colour target (F64)");
fclose(fsvg);
return ZINT_ERROR_INVALID_OPTION;
}