1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-20 11:27:09 +00:00

Updated form master

Don't fclose stdout
This commit is contained in:
tgotic
2011-01-17 19:47:42 +01:00
parent 18a2240cc4
commit 4b0e6e1123

View File

@@ -58,7 +58,7 @@ int svg_plot(struct zint_symbol *symbol)
} }
if(fsvg == NULL) { if(fsvg == NULL) {
strcpy(symbol->errtxt, "Could not open output file"); strcpy(symbol->errtxt, "Could not open output file");
return ERROR_FILE_ACCESS; return ZERROR_FILE_ACCESS;
} }
/* sort out colour options */ /* sort out colour options */
@@ -67,21 +67,21 @@ int svg_plot(struct zint_symbol *symbol)
if(strlen(symbol->fgcolour) != 6) { if(strlen(symbol->fgcolour) != 6) {
strcpy(symbol->errtxt, "Malformed foreground colour target"); strcpy(symbol->errtxt, "Malformed foreground colour target");
return ERROR_INVALID_OPTION; return ZERROR_INVALID_OPTION;
} }
if(strlen(symbol->bgcolour) != 6) { if(strlen(symbol->bgcolour) != 6) {
strcpy(symbol->errtxt, "Malformed background colour target"); strcpy(symbol->errtxt, "Malformed background colour target");
return ERROR_INVALID_OPTION; return ZERROR_INVALID_OPTION;
} }
error_number = is_sane(SSET, (unsigned char*)symbol->fgcolour, strlen(symbol->fgcolour)); error_number = is_sane(SSET, (unsigned char*)symbol->fgcolour, strlen(symbol->fgcolour));
if (error_number == ERROR_INVALID_DATA) { if (error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Malformed foreground colour target"); strcpy(symbol->errtxt, "Malformed foreground colour target");
return ERROR_INVALID_OPTION; return ZERROR_INVALID_OPTION;
} }
error_number = is_sane(SSET, (unsigned char*)symbol->bgcolour, strlen(symbol->bgcolour)); error_number = is_sane(SSET, (unsigned char*)symbol->bgcolour, strlen(symbol->bgcolour));
if (error_number == ERROR_INVALID_DATA) { if (error_number == ZERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Malformed background colour target"); strcpy(symbol->errtxt, "Malformed background colour target");
return ERROR_INVALID_OPTION; return ZERROR_INVALID_OPTION;
} }
locale = setlocale(LC_ALL, "C"); locale = setlocale(LC_ALL, "C");
@@ -240,7 +240,7 @@ int svg_plot(struct zint_symbol *symbol)
dy = my - 1.0 + yoffset; dy = my - 1.0 + yoffset;
ey = my - 0.5 + yoffset; ey = my - 0.5 + yoffset;
fy = my + 0.5 + yoffset; fy = my + 0.5 + yoffset;
if(r % 2 == 1) { if(r & 1) {
mx = (2.46 * i) + 1.23 + 1.23; mx = (2.46 * i) + 1.23 + 1.23;
} else { } else {
mx = (2.46 * i) + 1.23; mx = (2.46 * i) + 1.23;
@@ -604,6 +604,7 @@ int svg_plot(struct zint_symbol *symbol)
fprintf(fsvg, " </g>\n"); fprintf(fsvg, " </g>\n");
fprintf(fsvg, "</svg>\n"); fprintf(fsvg, "</svg>\n");
if((symbol->output_options & BARCODE_STDOUT) == 0)
fclose(fsvg); fclose(fsvg);
if (locale) if (locale)