From 6b6bb25f895a028149053a52d0fea6b356da0b45 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Fri, 14 Jan 2005 04:30:18 +0000 Subject: [PATCH] PostScript: missing newline and excess percents --- src/tuxpaint.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index a476febde..cf114b943 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -12370,13 +12370,6 @@ static int do_png_save(FILE * fi, const char * const fname, SDL_Surface * surf) // My intent was to let anyone do anything they wanted with the source as // long as some attribution was given. -static const char ps_footer[] = - "%%%%EndData\n" - "grestore\n" - "showpage\n" - "%%%%EOF\n" -; - /* Actually save the PostScript data to the file stream: */ static int do_ps_save(FILE * fi, const char *restrict const fname, SDL_Surface * surf) { @@ -12448,7 +12441,12 @@ static int do_ps_save(FILE * fi, const char *restrict const fname, SDL_Surface } free(ps_row); - fwrite(ps_footer,1,strlen(ps_footer),fi); + fprintf(fi, "\n"); + fprintf(fi, "%%%%EndData\n"); + fprintf(fi, "grestore\n"); + fprintf(fi, "showpage\n"); + fprintf(fi, "%%%%EOF\n"); + fclose(fi); return 1; }