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

@ -105,7 +105,7 @@ int svg_plot(struct zint_symbol *symbol) {
fsvg = fopen(symbol->outfile, "w");
}
if (fsvg == NULL) {
strcpy(symbol->errtxt, "Could not open output file (F60)");
strcpy(symbol->errtxt, "660: Could not open output file");
return ZINT_ERROR_FILE_ACCESS;
}
@ -114,24 +114,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 (F61)");
strcpy(symbol->errtxt, "661: Malformed foreground colour target");
fclose(fsvg);
return ZINT_ERROR_INVALID_OPTION;
}
if (strlen(symbol->bgcolour) != 6) {
strcpy(symbol->errtxt, "Malformed background colour target (F62)");
strcpy(symbol->errtxt, "662: Malformed background colour target");
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 (F63)");
strcpy(symbol->errtxt, "663: Malformed foreground colour target");
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 (F64)");
strcpy(symbol->errtxt, "664: Malformed background colour target");
fclose(fsvg);
return ZINT_ERROR_INVALID_OPTION;
}